整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:

第51节 可编辑的内容-Javascript-零点程序员-王唯

内容是《Web前端开发之Javascript视频》的课件,请配合大师哥《Javascript》视频课程学习。

在HTML中,任何元素都可以被编辑;启用编辑功能:HTML标签设置contenteditable属性,或者在Javascript中设置该元素的contentEditable属性;

<div id="editor" contenteditable>单击编辑</div>
<div id="mydiv">也可编辑</div>
<script>
var mydiv = document.getElementById("mydiv");
mydiv.contentEditable = true;
</script>

元素被设置成可编辑后,除了常规的插入删除等操作外,还可以使用document.execCommand()方法对当前选择的内容进行编辑,比如,设置文本的样式,如加粗、倾斜等;

另外,有些浏览器允许键盘快捷键(如Ctrl+B加粗)来加粗当前选中的文本,Firefox使用Ctrl+B和Ctrl+I;

contenteditable也存在着兼容问题,如,当回车换行时,不同的浏览器有不同有处理,标准浏览器一般会使用div,而IE会使用p来分段,有些会使用br;所以,可以使用一个替代的方案document.execCommand()方法;如:

mydiv.addEventListener("keydown", function(e){
    if(e.keyCode == 13)
        document.execCommand("defaultParagraphSeparator", false, "p");
});

HTMLElement.isContentEditable属性:

只读属性返回一个布尔值:如果当前元素的内容为可编辑状态,则返回true,否则返回false;

var mydiv = document.getElementById("mydiv");
mydiv.contentEditable = true;
console.log(mydiv.isContentEditable);

浏览器有可能为表单控件和具有contenteditable元素支持自动拼写检查;在支持该功能的浏览器中,检查可能默认开启或关闭;为元素添加spellcheck属性来显式开启拼写检查,或设置为false来显式关闭该功能;

designMode属性:

将Document对象的designMode属性设置为”on”使得整个文档可编辑,设置为”off”将恢复为只读文档;designMode属性并没有对应的HTML属性;

window.onload = function(){
    document.designMode = "on";
}

如,使<iframe>内部的文档可编辑;

<iframe id="editor" src="about:blank"></iframe>
<script>
window.onload = function(){
    var editor = document.getElementById("editor");
    editor.contentDocument.designMode = "on";
}
</script>

document.execCommand()方法:

浏览器定义了多个文本编辑命令,但大部分没有键盘快捷键;为了执行这些命令,可以使用Document对象的execCommand()方法;当HTML文档切换到designMode模式或存在可编辑元素或当前选择或给出范围,就可以使用此方法运行命令来操纵内容区域的元素;

语法:bool = document.execCommand(aCommandName, aShowDefaultUI, aValueArgument);

其返回一个Boolean值,如果是false,则表示操作不被支持或未被启用;该方法需要三个参数:aCommandName命令名称,如”bold”、”subscript”、”justifycenter”和”insertimage”等之类的字符串;aShowDefaultUI是个布尔值,表示浏览器要不要提示用户输入所需要值,一般为false;aValueArgument为用户输入的值,默认为null;

<div id="mydiv">Web前端开发</div>
<button id="btnBold">加粗</button>
<button id="btnLink">插入链接</button>
<script>
var mydiv = document.getElementById("mydiv");
mydiv.contentEditable = true;
var btnBold = document.getElementById("btnBold");
btnBold.addEventListener("click",bold, false);
function bold(){
    document.execCommand("bold");
}
var btnLink = document.getElementById("btnLink");
btnLink.addEventListener("click", link, false);
function link(){
    var url = prompt("输入链接URL:");
    if(url)
        document.execCommand("createlink", true,url);
}
</script>

命令列表:

  • 2D-Position:允许通过拖曳移动绝对定位的对象;
  • AbsolutePosition:设定元素的 position 属性为“absolute”(绝对);
  • backColor:修改文档的背景颜色,需要一个<color>类型的字符串值作为参数传入,注:IE浏览器用这个设置文字的背景颜色;
  • BlockDirLTR:目前尚未支持;
  • BlockDirRTL:目前尚未支持;
  • bold:开启或关闭选中文字或插入点的粗体字效果,IE使用 <strong>标签,而不是<b>标签;
  • BrowseMode:目前尚未支持;
  • ClearAuthenticationCache:清除缓存中的所有身份验证凭据;
  • contentReadOnly:通过传入一个布尔参数设置文档内容的可编辑性;(IE浏览器不支持)
  • copy:拷贝当前选中内容到剪贴板;
  • CreateBookmark:创建一个书签锚或获取当前选中区或插入点的书签锚的名称;
  • createLink:将选中内容创建为一个锚链接,该命令需要一个hrefURI字符串作为参数值传入;
  • cut:剪贴当前选中的文字并复制到剪贴板;
  • decreaseFontSize:给选中文字加上<small>标签,或在选中点插入该标签;(IE浏览器不支持)
  • defaultParagraphSeparator:更改在可编辑文本区域中创建新段落时使用的段落分隔符
  • delete:删除选中部分;
  • DirLTR:目前尚未支持;
  • DirRTL:目前尚未支持;
  • EditMode:目前尚未支持;
  • enableAbsolutePositionEditor:启用或禁用允许移动绝对定位元素的抓取器;
  • enableInlineTableEditing:启用或禁用表格行和列插入和删除控件;(IE浏览器不支持)
  • enableObjectResizing:启用或禁用图像和其他对象的大小可调整大小手柄;(IE浏览器不支持)
  • fontName:在插入点或者选中文字部分修改字体名称,需要提供一个字体名称字符串 (例如:"Arial")作为参数;
  • fontSize:在插入点或者选中文字部分修改字体大小,需要提供一个HTML字体尺寸 (1-7) 作为参数;
  • foreColor:在插入点或者选中文字部分修改字体颜色,需要提供一个颜色值字符串作为参数;
  • formatBlock:添加一个HTML块式标签在包含当前选择的行, 如果已经存在了,更换包含该行的块元素 (在 Firefox中, BLOCKQUOTE 是一个例外 -它将包含任何包含块元素);需要提供一个标签名称字符串作为参数;几乎所有的块样式标签都可以使用(例如. "H1", "P", "DL", "BLOCKQUOTE");(IE浏览器仅仅支持标题标签 H1 - H6, ADDRESS, 和 PRE,使用时还必须包含标签分隔符 < >, 例如 "<H1>");
  • forwardDelete:删除光标所在位置的字符,和按下删除键一样;
  • heading:添加一个标题标签在光标处或者所选文字上,需要提供标签名称字符串作为参数 (例如. "H1", "H6"). (IE 和 Safari不支持);
  • hiliteColor:更改选择或插入点的背景颜色,需要一个颜色值字符串作为值参数传递;UseCSS 必须开启此功能。(IE浏览器不支持);
  • increaseFontSize:在选择或插入点周围添加一个BIG标签;(IE浏览器不支持)
  • indent:缩进选择或插入点所在的行,在 Firefox 中, 如果选择多行,但是这些行存在不同级别的缩进, 只有缩进最少的行被缩进;
  • InlineDirLTR:目前尚未支持;
  • InlineDirRTL:目前尚未支持;
  • insertBrOnReturn:控制当按下Enter键时,是插入br标签还是把当前块元素变成两个;(IE浏览器不支持);
  • InsertButton:用按钮控件覆盖当前选中区;
  • InsertFieldset:用方框覆盖当前选中区;
  • insertHorizontalRule:在插入点插入一个水平线(删除选中的部分);
  • insertHTML:在插入点插入一个HTML字符串(删除选中的部分),需要一个个HTML字符串作为参数;(IE浏览器不支持);
  • InsertIFrame:用内嵌框架覆盖当前选中区;
  • insertImage:在插入点插入一张图片(删除选中的部分),需要一个 URL 字符串作为参数,这个 URL 图片地址至少包含一个字符,空白字符也可以(IE会创建一个链接其值为null);
  • InsertInputButton:用按钮控件覆盖当前选中区;
  • InsertInputCheckbox:用复选框控件覆盖当前选中区;
  • InsertInputFileUpload:用文件上载控件覆盖当前选中区;
  • InsertInputHidden:插入隐藏控件覆盖当前选中区;
  • InsertInputImage:用图像控件覆盖当前选中区;
  • InsertInputPassword:用密码控件覆盖当前选中区;
  • InsertInputRadio:用单选钮控件覆盖当前选中区;
  • InsertInputReset:用重置控件覆盖当前选中区;
  • InsertInputSubmit:用提交控件覆盖当前选中区;
  • InsertInputText:用文本控件覆盖当前选中区;
  • InsertMarquee:用空字幕覆盖当前选中区;
  • insertOrderedList:在插入点或者选中文字上创建一个有序列表;
  • insertUnorderedList:在插入点或者选中文字上创建一个无序列表;
  • insertParagraph:在选择或当前行周围插入一个段落;(IE会在插入点插入一个段落并删除选中的部分)
  • InsertSelectDropdown:用下拉框控件覆盖当前选中区;
  • InsertSelectListbox:用列表框控件覆盖当前选中区;
  • InsertTextArea:用多行文本输入控件覆盖当前选中区;
  • insertText:在光标插入位置插入文本内容或者覆盖所选的文本内容;
  • InsertUnorderedList:切换当前选中区是项目符号列表还是常规格式化块;
  • italic:在光标插入点开启或关闭斜体字;(IE使用EM标签,而不是I );
  • justifyCenter:对光标插入位置或者所选内容进行文字居中;
  • justifyFull:对光标插入位置或者所选内容进行文本对齐;
  • justifyLeft:对光标插入位置或者所选内容进行左对齐;
  • justifyRight:对光标插入位置或者所选内容进行右对齐;
  • JustifyNone:目前尚未支持;
  • LiveResize:迫使 MSHTML 编辑器在缩放或移动过程中持续更新元素外观,而不是只在移动或缩放完成后更新;
  • MultipleSelection:允许当用户按住 Shift 或 Ctrl 键时一次选中多于一个站点可选元素;
  • open:打开;
  • outdent:对光标插入行或者所选行内容减少缩进量;
  • OverWrite:切换文本状态的插入和覆盖;
  • paste:在光标位置粘贴剪贴板的内容,如果有被选中的内容,会被替换;剪贴板功能必须在 user.js 配置文件中启用;
  • PlayImage:目前尚未支持
  • Print:打开打印对话框以便用户可以打印当前页;
  • redo:重做被撤销的操作;
  • Refresh:刷新当前文档;
  • removeFormat:对所选内容去除所有格式;
  • RemoveParaFormat:目前尚未支持;
  • SaveAs:将当前 Web 页面保存为文件;
  • selectAll:选中编辑区里的全部内容;
  • SizeToControl:目前尚未支持;
  • SizeToControlHeight:目前尚未支持;
  • SizeToControlWidth:目前尚未支持;
  • Stop:停止;
  • StopImage:目前尚未支持;
  • strikeThrough:在光标插入点开启或关闭删除线;
  • subscript:在光标插入点开启或关闭下角标;
  • superscript:在光标插入点开启或关闭上角标;
  • UnBookmark:从当前选中区中删除全部书签;
  • underline:在光标插入点开启或关闭下划线;
  • undo:撤销最近执行的命令;
  • unlink:去除所选的锚链接<a>标签;
  • Unselect:清除当前选中区的选中状态;
  • useCSS:切换使用HTML tags还是CSS来生成标记,要求一个布尔值true/false作为参数;注: 这个属性是逻辑上的倒退 (例如. use false to use CSS, true to use HTML).(IE不支持);该属性已经废弃,使用 styleWithCSS 代替;
  • styleWithCSS:用这个取代 useCSS 命令,false 生成格式化元素;

不同的浏览器实现不同的编辑命令;只有少部分命令得到了很好的支持,所以在使用之前一定要检测浏览器是否支持该命令;

document.queryCommandSupport(command)方法:传入command命令名,返回一个布尔值,用来查询浏览器是否支持该命令;

var selectAll = document.queryCommandSupported("selectAll");
console.log(selectAll);

doument.queryCommandEnable(command)方法:传入command命令名,返回一个布尔值,查询浏览器中指定的编辑指令是否可用;

mydiv.addEventListener("mouseup",function(e){
    var createLink = document.queryCommandEnabled("createLink");
    console.log(createLink);
},false);

document.queryCommandState(command)方法:用来判定命令的当前状态:有一些命令如”bold”和”italic”有一个布尔值状态,开或关取决于当前选区或光标的位置;这些命令通常用工具栏上的开关按钮表示;

var flag = document.queryCommandState("bold");
console.log(flag);

document.queryCommandValue()方法:查询相关联的值,有些命令如”fontname”有一个相关联的值,字体系列名;

var fontSize = document.queryCommandValue("fontSize");
console.log(fontSize);  // 默认是3
var foreColor = document.queryCommandValue("foreColor");
console.log(foreColor);  // rgb(0,0,0)

document.queryCommandIndeterm(command)方法:返回一个布尔值,用于检测指定的命令是否处于不确定状态;例如,如果当前选取的文本使用了两种不同的字体,使用该方法查询”fontname”的结果是不确定的;

需要注意的是,这些编辑器生成的HTML标记很可能是杂乱无章的;

另外,一旦用户编辑了某元素的内容,就可以使用innerHTML属性得到已经编辑内容的HTML标记;如何处理这些富文本,有多种方式,可以把它存储在隐藏的表单控件中,并通过提交该表单发送到服务器,也可以保存在本地;

示例:一个HTML编辑器:

<head>
    <style>
        *{margin:0;padding:0; box-sizing: border-box;}
        #editor{width:600px;margin:100px auto;}
        #editor #toolBar1,#editor #toolBar2{width:100%;background-color: lightgray;}
        img.intLink{cursor:pointer;border:none;}
        #toolBar1 select{font-size:16px;}
        #textBox{width:100%; height:200px; border:1px solid;padding:10px; overflow:scroll;}
        #textBox #sourceText{margin:0;padding:0; min-width:498px; min-height:200px;}
    </style>
    <script>
        var oDoc, sDefTxt;
        function initDoc(){
            oDoc = document.getElementById("textBox");
            sDefTxt = oDoc.innerHTML;
            if(document.compForm.switchMode.checked)
                setDocMode(true);
        }
        function formatDoc(sCmd, sValue){
            if(validateMode()){
                document.execCommand(sCmd, false, sValue);
                oDoc.focus();
            }
        }
        function validateMode(){
            if(!document.compForm.switchMode.checked)
                return true;
            alert("Uncheck 'Show HTML");
            oDoc.focus();
            return false;
        }
        function setDocMode(bToSource){
            var oContent;
            if(bToSource){
                oContent = document.createTextNode(oDoc.innerHTML);
                oDoc.innerHTML = "";
                var oPre = document.createElement("pre");
                oDoc.contentEditable = false;
                oPre.id = "sourceText";
                oPre.contentEditable = true;
                oPre.appendChild(oContent);
                oDoc.appendChild(oPre);
                document.execCommand("defaultParagraphSeparator", false, "div");
            }else{
                if(document.all)
                    oDoc.innerHTML = oDoc.innerText;
                else{
                    oContent = document.createRange();
                    oContent.selectNodeContents(oDoc.firstChild);
                    oDoc.innerHTML = oContent.toString();
                }
                oDoc.contentEditable = true;
            }
            oDoc.focus();
        }
        function printDoc(){
            if(!validateMode())
                return;
            var oPrintWin = window.open("","_blank","width=450,height=450,left=400,top=100,menubar=yes,toolbar=no,scrollbars=yes");
            oPrintWin.document.open();
            oPrintWin.document.write("<!doctype html><html><head><title>打印<\/title><\/head><body onload='print();'>" + oDoc.innerHTML + "<\/body><\/html>");
            oPrintWin.document.close();
        }
    </script>
</head>
<body onload="initDoc()">
<div id="editor">
<form name="compForm" method="post" action="sample.php" onsubmit="if(validateMode()){this.myDoc.value=oDoc.innerHTML; return true;}return false;">
    <input type="hidden" name="myDoc">
    <div id="toolBar1">
        <select onchange="formatDoc('formatblock',this[this.selectedIndex].value); this.selectedIndex=0;">
            <option selected>-文本格式-</option>
            <option value="h1">标题1 <h1></option>
            <option value="h2">标题2 <h2></option>
            <option value="h3">标题3 <h3></option>
            <option value="h4">标题4 <h4></option>
            <option value="h5">标题5 <h5></option>
            <option value="h6">标题6 <h6></option>
            <option value="p">段落 <p></option>
            <option value="pre">预定义 <pre></option>
        </select>
        <select onchange="formatDoc('fontname', this[this.selectedIndex].value); this.selectedIndex=0;">
            <option class="heading" selected>-字体-</option>
            <option>Arial</option>
            <option>Arial Black</option>
            <option>Courier New</option>
            <option>Times New Roman</option>
        </select>
        <select onchange="formatDoc('fontsize',this[this.selectedIndex].value); this.selectedIndex=0;">
            <option class="heading" selected>-字号-</option>
            <option value="1">非常小</option>
            <option value="2">小</option>
            <option value="3">正常</option>
            <option value="4">中大</option>
            <option value="5">大</option>
            <option value="6">非常大</option>
            <option value="7">最大</option>
        </select>
        <select onchange="formatDoc('forecolor',this[this.selectedIndex].value); this.selectedIndex=0;">
            <option class="heading" selected>-颜色-</option>
            <option value="red">Red</option>
            <option value="blue">Blue</option>
            <option value="green">Green</option>
            <option value="black">Black</option>
        </select>
        <select onchange="formatDoc('backcolor',this[this.selectedIndex].value); this.selectedIndex=0;">
            <option class="heading" selected>-背景颜色-</option>
            <option value="red">Red</option>
            <option value="blue">Blue</option>
            <option value="green">Green</option>
            <option value="black">Black</option>
        </select>
    </div>
    <div id="toolBar2">
    <img class="intLink" src="icons/clean.gif" onclick="if(validateMode()&&confirm('确定清除所有吗?')){oDoc.innerHTML = sDefTxt};" /> 
    <img class="intLink" src="icons/print.png" onclick="printDoc();" /> 
    <img class="intLink" src="icons/undo.gif" onclick="formatDoc('undo');" /> 
    <img class="intLink" src="icons/redo.gif" onclick="formatDoc('redo');" /> 
    <img class="intLink" src="icons/format.png" onclick="formatDoc('removeFormat');" /> 
    <img class="intLink" src="icons/bold.gif" onclick="formatDoc('bold')" /> 
    <img class="intLink" src="icons/italic.gif" onclick="formatDoc('italic')" /> 
    <img class="intLink" src="icons/underline.gif" onclick="formatDoc('underline')" /> 
    <img class="intLink" src="icons/justifyleft.gif" onclick="formatDoc('justifyleft')" /> 
    <img class="intLink" src="icons/justifycenter.gif" onclick="formatDoc('justifycenter')" /> 
    <img class="intLink" src="icons/justifyright.gif" onclick="formatDoc('justifyright')" /> 
    <img class="intLink" src="icons/numberedlist.gif" onclick="formatDoc('insertorderedlist')" /> 
    <img class="intLink" src="icons/dottedlist.gif" onclick="formatDoc('insertunorderedlist')" /> 
    <img class="intLink" src="icons/quote.gif" onclick="formatDoc('formatblock','blockquote')" /> 
    <img class="intLink" src="icons/outdent.gif" onclick="formatDoc('outdent')" /> 
    <img class="intLink" src="icons/indent.gif" onclick="formatDoc('indent')" /> 
    <img class="intLink" src="icons/hyperlink.gif" onclick="var sLnk=prompt('输入链接地址','http:\/\/'); if(sLnk&&sLnk!=''&&sLnk!='http:\/\/'){formatDoc('createlink',sLnk);}" /> 
    <img class="intLink" src="icons/cut.gif" onclick="formatDoc('cut')" /> 
    <img class="intLink" src="icons/copy.gif" onclick="formatDoc('copy')" /> 
    <img class="intLink" src="icons/paste.gif" onclick="formatDoc('paste')" /> 
    </div>
    <div id="textBox" contenteditable="true"><p>富文本编辑器</p></div>
    <p id="editMode">
        <input type="checkbox" name="switchMode" id="switchBox" onchange="setDocMode(this.checked);">
        <label for="switchBox">显示HTML</label>
    </p>
    <p><input type="submit" value="保存" /></p>
</form>
</div>
</body>

这些浏览器内置的编辑功能对用户输入少量的富文本来说,足够使用了;但要解决所有种类的文档的编辑来说,这些API还显得不足;在实际开发中,一般采用的是第三方的类库,比如百度UEditor和layui.layedit和Dojo,它们都包含了编辑器组件;

享兴趣,传播快乐,增长见闻,留下美好!亲爱的您,这里是LearningYard学苑。今天小编为大家带来“话说前端47-vue常用指令”,欢迎您的访问。

Share interests, spread happiness, increase knowledge, and leave good! Dear you, this is LearningYard Academy. Today's editor brings you "Tuesday Share (47) | Implementation Principles of Total Quality Management". Welcome to visit.

指令是什么:Vue 指令是以 v- 开头的,作用在 HTML 上将指令绑定在元素上时,会给绑定的元素添加一些特殊行为,可将指令视作 特殊的 HTML 属性 attribute。指令的职责是: 当表达式的值改变时,将其产生的连带影响,响应式地作用于 DOM。

What is the instruction? Vue instruction starts with v-. When it acts on HTML to bind the instruction to an element, it will add some special behaviors to the bound element, and the instruction can be regarded as a special HTML attribute. The duty of the instruction is: when the value of the expression changes, it will affect the DOM responsively.

插值指令之v-text​:v-text 通过设置元素的 textContent 属性来工作,因此它将覆盖元素中所有现有的内容。如果你需要更新 textContent 的部分,应该使用 mustache 代替。

V-text of the interpolation instruction: V-text works by setting the textContent property of the element, so it will overwrite all existing contents in the element. If you need to update the part of textContent, you should use mustache instead.

v-html:双大括号会将数据解释为普通文本,而非 HTML 代码。为了输出真正的 HTML,你需要使用 v-html 指令:v-html类似innerHTML。

注意:在网站上动态渲染任意 HTML 是非常危险的,因为容易导致 XSS 攻击。只在可信内容上使用 v-html,永不用在用户提交的内容上。

V-html: Double braces will interpret the data as normal text, not HTML code. In order to output real HTML, you need to use the v-html command: v-html is similar to innerHTML.

Note: It is very dangerous to dynamically render arbitrary HTML on the website, because it will easily lead to XSS attacks. Use v-html only for trusted content, and never for content submitted by users.

XXS 攻击:XSS是Cross Site Scripting的简称(为了区分CSS因此成为XSS),跨站脚本攻击。通过在留言板,评论,输入框等用户输入的地方,前端仅进行html展示的地方。有些人利用这个特性,在输入框中输入一些恶意的脚本比如,通过这些脚本窃取网页浏览中的cookie值、劫持网页流量实现恶意跳转。

XXS attack: XSS is short for Cross Site Scripting (hence XSS for distinguishing CSS), and cross-site scripting attack. Through the message board, comments, input boxes and other places where users input, the front end only displays html. Some people use this feature to enter some malicious scripts in the input box, for example, stealing cookie values in web browsing and hijacking web traffic through these scripts to achieve malicious jumps.

XSS预防​:1.​过滤script img a等标签,包括过滤大小写()、绕过利用过滤后的内容再次构成攻击语句(<scrIPT>>)、绕过 img标签的攻击(<img src=‘....’/>)、a div等标签添加触发事件() 2.将一些特殊的关键字进行编码后输出,如alert(1)编码过后就是\u0061\u006c\u0065\u0072\u0074(1) 3.限制输入框长度。

XSS prevention: 1. Filter scrIPT img a and other tags, including case filtering (), bypassing the filtered content to form attack statements again (< script > >), attacks bypassing the img tag (< img src =' ...'/>), adding trigger events to tags such as a div () 2. Encode some special keywords and output them, such as alert(1).

今天的分享就到这里,如果您对今天的文章有独到的见解,欢迎给我们留言,让我们相约明天,祝您今天过得开心快乐!

Today's share is over here, if you have unique views on today's article, welcome to leave a message for us, let us meet tomorrow, I wish you a happy and happy today!

本文由learningyard新学苑原创,如有侵权,请联系我们

翻译来源:谷歌翻译

文案&排版|李仕阳

审核|闫庆红

md命令大全

开始→运行→CMD→键入以下命令即可:

gpedit.msc-----组策略 sndrec32-------录音机

Nslookup-------IP地址侦测器 explorer-------打开资源管理器

logoff---------注销命令 tsshutdn-------60秒倒计时关机命令

lusrmgr.msc----本机用户和组 services.msc---本地服务设置

oobe/msoobe /a----检查XP是否激活 notepad--------打开记事本

cleanmgr-------垃圾整理 net start messenger----开始信使服务

compmgmt.msc---计算机管理 net stop messenger-----停止信使服务

conf-----------启动netmeeting dvdplay--------DVD播放器

charmap--------启动字符映射表 diskmgmt.msc---磁盘管理实用程序

calc-----------启动计算器 dfrg.msc-------磁盘碎片整理程序

chkdsk.exe-----Chkdsk磁盘检查 devmgmt.msc--- 设备管理器

regsvr32 /u *.dll----停止dll文件运行 drwtsn32------ 系统医生

rononce -p ----15秒关机 dxdiag---------检查DirectX信息

regedt32-------注册表编辑器 Msconfig.exe---系统配置实用程序

rsop.msc-------组策略结果集 mem.exe--------显示内存使用情况

regedit.exe----注册表 winchat--------XP自带局域网聊天

progman--------程序管理器 winmsd---------系统信息

perfmon.msc----计算机性能监测程序 winver---------检查Windows版本

sfc /scannow-----扫描错误并复原 winipcfg-------IP配置

taskmgr-----任务管理器(2000/xp/2003) command--------cmd

fsmgmt.msc 共享文件夹 netstat -an----查看端口

osk 屏幕键盘 install.asp----修改注册网页

eventvwr.msc 事件查看器

secpol.msc 本地安全设置

services.msc 服务

2K

accwiz.exe > 辅助工具向导

acsetups.exe > acs setup dcom server executable

actmovie.exe > 直接显示安装工具

append.exe > 允许程序打开制定目录中的数据

arp.exe > 显示和更改计算机的ip与硬件物理地址的对应列表

at.exe > 计划运行任务

atmadm.exe > 调用管理器统计

attrib.exe > 显示和更改文件和文件夹属性

autochk.exe > 检测修复文件系统

autoconv.exe > 在启动过程中自动转化系统

autofmt.exe > 在启动过程中格式化进程

autolfn.exe > 使用长文件名格式

bootok.exe > boot acceptance application for registry

bootvrfy.exe > 通报启动成功

cacls.exe > 显示和编辑acl

calc.exe > 计算器

cdplayer.exe > cd播放器

change.exe > 与终端服务器相关的查询

charmap.exe > 字符映射表

chglogon.exe > 启动或停用会话记录

chgport.exe > 改变端口(终端服务)

chgusr.exe > 改变用户(终端服务)

chkdsk.exe > 磁盘检测程序

chkntfs.exe > 磁盘检测程序

cidaemon.exe > 组成ci文档服务

cipher.exe > 在ntfs上显示或改变加密的文件或目录

cisvc.exe > 索引内容

ckcnv.exe > 变换cookie

cleanmgr.exe > 磁盘清理

cliconfg.exe > sql客户网络工具

clipbrd.exe > 剪贴簿查看器

clipsrv.exe > 运行clipboard服务

clspack.exe > 建立系统文件列表清单

cluster.exe > 显示域的集群

_cmd_.exe > 没什么好说的!

cmdl32.exe > 自动下载连接管理

cmmgr32.exe > 连接管理器

cmmon32.exe > 连接管理器监视

cmstp.exe > 连接管理器配置文件安装程序

comclust.exe > 集群

comp.exe > 比较两个文件和文件集的内容*

compact.exe > 显示或改变ntfs分区上文件的压缩状态

conime.exe > ime控制台

control.exe > 控制面板

convert.exe > 转换文件系统到ntfs

convlog.exe > 转换iis日志文件格式到ncsa格式

cprofile.exe > 转换显示模式

cscript.exe > 较本宿主版本

csrss.exe > 客户服务器runtime进程

csvde.exe > 日至格式转换程序

dbgtrace.exe > 和terminal server相关

dcomcnfg.exe > dcom配置属性

dcphelp.exe > ?

dcpromo.exe > ad安装向导

ddeshare.exe > dde共享

ddmprxy.exe >

debug.exe > 就是debug啦!

dfrgfat.exe > fat分区磁盘碎片整理程序

dfrgntfs.exe > ntfs分区磁盘碎片整理程序

dfs_cmd_.exe > 配置一个dfs树

dfsinit.exe > 分布式文件系统初始化

dfssvc.exe > 分布式文件系统服务器

diantz.exe > 制作cab文件

diskperf.exe > 磁盘性能计数器

dllhost.exe > 所有com+应用软件的主进程

dllhst3g.exe >

dmadmin.exe > 磁盘管理服务

dmremote.exe > 磁盘管理服务的一部分

dns.exe > dns applications dns

doskey.exe > 命令行创建宏

dosx.exe > dos扩展

dplaysvr.exe > 直接运行帮助

drwatson.exe > 华生医生错误检测

drwtsn32.exe > 华生医生显示和配置管理

dtcsetup.exe > installs mdtc

dvdplay.exe > dvd播放

dxdiag.exe > direct-x诊断工具

edlin.exe > 命令行的文本编辑器(历史悠久啊!)

edlin.exe > 命令行的文本编辑器(历史悠久啊!)

esentutl.exe > ms数据库工具

eudcedit.exe > type造字程序

eventvwr.exe > 事件查看器

evnt_cmd_.exe > event to trap translator; configuration tool

evntwin.exe > event to trap translator setup

exe2bin.exe > 转换exe文件到二进制

expand.exe > 解压缩

extrac32.exe > 解cab工具

fastopen.exe > 快速访问在内存中的硬盘文件

faxcover.exe > 传真封面编辑

faxqueue.exe > 显示传真队列

faxsend.exe > 发送传真向导

faxsvc.exe > 启动传真服务

fc.exe > 比较两个文件的不同

find.exe > 查找文件中的文本行

findstr.exe > 查找文件中的行

finger.exe > 一个用户并显示出统计结果

fixmapi.exe > 修复mapi文件

flattemp.exe > 允许或者禁用临时文件目录

fontview.exe > 显示字体文件中的字体

forcedos.exe > forces a file to start in dos mode. 强制文件在dos模式下运行

freecell.exe > popular windows game 空当接龙

ftp.exe > file transfer protocol used to transfer files over a network conne

ction 就是ftp了

gdi.exe > graphic device interface 图形界面驱动

grovel.exe >

grpconv.exe > program manager group convertor 转换程序管理员组

help.exe > displays help for windows 2000 commands 显示帮助

hostname.exe > display hostname for machine. 显示机器的hostname

ie4uinit.exe > ie5 user install tool ie5用户安装工具

ieshwiz.exe > customize folder wizard 自定义文件夹向导

iexpress.exe > create and setup packages for install 穿件安装包

iisreset.exe > restart iis admin service 重启iis服务

internat.exe > keyboard language indicator applet 键盘语言指示器

ipconfig.exe > windows 2000 ip configuration. 察看ip配置

ipsecmon.exe > ip security monitor ip安全监视器

ipxroute.exe > ipx routing and source routing control program ipx路由和源路由

控制程序

irftp.exe > setup ftp for wireless communication 无线连接

ismserv.exe > intersite messaging service 安装或者删除service control manage

r中的服务

jdbgmgr.exe > microsoft debugger for java 4 java4的调试器

jetconv.exe > convert a jet engine database 转换jet engine数据库

jetpack.exe > compact jet database. 压缩jet数据库

jview.exe > command-line loader for java java的命令行装载者

krnl386.exe > core component for windows 2000 2000的核心组件

label.exe > change label for drives 改变驱动器的卷标

lcwiz.exe > license compliance wizard for local or remote systems. 许可证符合

向导

ldifde.exe > ldif cmd line manager ldif目录交换命令行管理

licmgr.exe > terminal server license manager 终端服务许可协议管理

lights.exe > display connection status lights 显示连接状况

llsmgr.exe > windows 2000 license manager 2000许可协议管理

llssrv.exe > start the license server 启动许可协议服务器

lnkstub.exe >

locator.exe > rpc locator 远程定位

lodctr.exe > load perfmon counters 调用性能计数

logoff.exe > log current user off. 注销用户

lpq.exe > displays status of a remote lpd queue 显示远端的lpd打印队列的状态,

显示被送到基于unix的服务器的打印任务

lpr.exe > send a print job to a network printer. 重定向打印任务到网络中的打印

机。通常用于unix客户打印机将打印任务发送给连接了打印设备的nt的打印机服务器。

lsass.exe > lsa executable and server dll 运行lsa和server的dll

lserver.exe > specifies the new dns domain for the default server 指定默认se

rver新的dns域

os2.exe > an os/2 warp server (os2 /o) os/2

os2srv.exe > an os/2 warp server os/2

os2ss.exe > an os/2 warp server os/2

osk.exe > on screen keyboard 屏幕键盘

packager.exe > windows 2000 packager manager 对象包装程序

pathping.exe > combination of ping and tracert 包含ping和tracert的程序

pax.exe > is a posix program and path names used as arguments must be specif

ied in posix format. use "//c/users/default" instead of "c:usersdefault."

启动便携式存档互换 (pax) 实用程序

pentnt.exe > used to check the pentium for the floating point division error

. 检查pentium的浮点错误

perfmon.exe > starts windows performance monitor 性能监视器

ping.exe > packet internet groper 验证与远程计算机的连接

posix.exe > used for backward compatibility with unix 用于兼容unix

print.exe > cmd line used to print files 打印文本文件或显示打印队列的内容。

progman.exe > program manager 程序管理器

proquota.exe > profile quota program

psxss.exe > posix subsystem application posix子系统应用程序

qappsrv.exe > displays the available application terminal servers on the net

work

在网络上显示终端服务器可用的程序

qprocess.exe > display information about processes local or remote 在本地或远

程显示进程的信息(需终端服务)

query.exe > query termserver user process and sessions 查询进程和对话

quser.exe > display information about a user logged on 显示用户登陆的信息(需

终端服务)

qwinsta.exe > display information about terminal sessions. 显示终端服务的信息

rasadmin.exe > start the remote access admin service 启动远程访问服务

rasautou.exe > creates a ras connection 建立一个ras连接

rasdial.exe > dial a connection 拨号连接

ras.exe > starts a ras connection 运行ras连接

rcp.exe > copies a file from and to a rcp service. 在 windows 2000 计算机和运

行远程外壳端口监控程序 rshd 的系统之间复制文件

rdpclip.exe > rdpclip allows you to copy and paste files between a terminal

session and client console session. 再终端和本地复制和粘贴文件

recover.exe > recovers readable information from a bad or defective disk 从坏

的或有缺陷的磁盘中恢复可读取的信息。

redir.exe > starts the redirector service 运行重定向服务

regedt32.exe > 32-bit register service 32位注册服务

regini.exe > modify registry permissions from within a script 用脚本修改注册

许可

register.exe > register a program so it can have special execution character

istics. 注册包含特殊运行字符的程序

regsvc.exe >

regsvr32.exe > registers and unregister's dll's. as to how and where it regi

ster's them i dont know. 注册和反注册dll

regtrace.exe > options to tune debug options for applications failing to dum

p trace statements

trace 设置

regwiz.exe > registration wizard 注册向导

remrras.exe >

replace.exe > replace files 用源目录中的同名文件替换目标目录中的文件。

reset.exe > reset an active section 重置活动部分

rexec.exe > runs commands on remote hosts running the rexec service. 在运行

rexec 服务的远程计算机上运行命令。rexec 命令在执行指定命令前,验证远程计算机

上的用户名,只有安装了 tcp/ip 协议后才可以使用该命令。

risetup.exe > starts the remote installation service wizard. 运行远程安装向导

服务

route.exe > display or edit the current routing tables. 控制网络路由表

routemon.exe > no longer supported 不再支持了!

router.exe > router software that runs either on a dedicated dos or on an os

. 检查pentium的浮点错误

perfmon.exe > starts windows performance monitor 性能监视器

ping.exe > packet internet groper 验证与远程计算机的连接

posix.exe > used for backward compatibility with unix 用于兼容unix

print.exe > cmd line used to print files 打印文本文件或显示打印队列的内容。

progman.exe > program manager 程序管理器

proquota.exe > profile quota program

psxss.exe > posix subsystem application posix子系统应用程序

qappsrv.exe > displays the available application terminal servers on the net

work

在网络上显示终端服务器可用的程序

qprocess.exe > display information about processes local or remote 在本地或远

程显示进程的信息(需终端服务)

query.exe > query termserver user process and sessions 查询进程和对话

quser.exe > display information about a user logged on 显示用户登陆的信息(需

终端服务)

qwinsta.exe > display information about terminal sessions. 显示终端服务的信息

rasadmin.exe > start the remote access admin service 启动远程访问服务

rasautou.exe > creates a ras connection 建立一个ras连接

rasdial.exe > dial a connection 拨号连接

ras.exe > starts a ras connection 运行ras连接

rcp.exe > copies a file from and to a rcp service. 在 windows 2000 计算机和运

行远程外壳端口监控程序 rshd 的系统之间复制文件

rdpclip.exe > rdpclip allows you to copy and paste files between a terminal

session and client console session. 再终端和本地复制和粘贴文件

recover.exe > recovers readable information from a bad or defective disk 从坏

的或有缺陷的磁盘中恢复可读取的信息。

redir.exe > starts the redirector service 运行重定向服务

regedt32.exe > 32-bit register service 32位注册服务

regini.exe > modify registry permissions from within a script 用脚本修改注册

许可

register.exe > register a program so it can have special execution character

istics. 注册包含特殊运行字符的程序

regsvc.exe >

regsvr32.exe > registers and unregister's dll's. as to how and where it regi

ster's them i dont know. 注册和反注册dll

regtrace.exe > options to tune debug options for applications failing to dum

p trace statements

trace 设置

regwiz.exe > registration wizard 注册向导

remrras.exe >

replace.exe > replace files 用源目录中的同名文件替换目标目录中的文件。

reset.exe > reset an active section 重置活动部分

rexec.exe > runs commands on remote hosts running the rexec service. 在运行

rexec 服务的远程计算机上运行命令。rexec 命令在执行指定命令前,验证远程计算机

上的用户名,只有安装了 tcp/ip 协议后才可以使用该命令。

risetup.exe > starts the remote installation service wizard. 运行远程安装向导

服务

route.exe > display or edit the current routing tables. 控制网络路由表

routemon.exe > no longer supported 不再支持了!

router.exe > router software that runs either on a dedicated dos or on an os

/2 system. route软件在 dos或者是os/2系统

rsh.exe > runs commands on remote hosts running the rsh service 在运行 rsh 服

务的远程计算机上运行命令

rsm.exe > mounts and configures remote system media 配置远程系统媒体

rsnotify.exe > remote storage notification recall 远程存储通知回显

rsvp.exe > resource reservation protocol 源预约协议

runas.exe > run a program as another user 允许用户用其他权限运行指定的工具和

程序

rundll32.exe > launches a 32-bit dll program 启动32位dll程序

runonce.exe > causes a program to run during startup 运行程序再开始菜单中

rwinsta.exe > reset the session subsystem hardware and software to known ini

tial values 重置会话子系统硬件和软件到最初的值

savedump.exe > does not write to e:winntuser.dmp 不写入user.dmp中

scardsvr.exe > smart card resource management server 子能卡资源管理服务器

schupgr.exe > it will read the schema update files (.ldf files) and upgrade

the schema. (part of adsi) 读取计划更新文件和更新计划

secedit.exe > starts security editor help 自动安全性配置管理

services.exe > controls all the services 控制所有服务

sethc.exe > set high contrast - changes colours and display mode logoff to s

et it back to normal 设置高对比

setreg.exe > shows the software publishing state key values 显示软件发布的国

家语言

setup.exe > gui box prompts you to goto control panel to configure system co

mponents 安装程序(转到控制面板)

setver.exe > set version for files 设置 ms-dos 子系统向程序报告的 ms-dos 版本

sfc.exe > system file checker test and check system files for integrity 系统

文件检查

sfmprint.exe > print services for macintosh 打印macintosh服务

sfmpsexe.exe >

sfmsvc.exe >

shadow.exe > monitor another terminal services session. 监控另外一台中端服务

器会话

share.exe > windows 2000 和 ms-dos 子系统不使用该命令。接受该命令只是为了与

ms-dos 文件兼容

shmgrate.exe >

shrpubw.exe > create and share folders 建立和共享文件夹

sigverif.exe > file signature verification 文件签名验证

skeys.exe > serial keys utility 序列号制作工具

smlogsvc.exe > performance logs and alerts 性能日志和警报

smss.exe >

sndrec32.exe > starts the windows sound recorder 录音机

sndvol32.exe > display the current volume information 显示声音控制信息

snmp.exe > simple network management protocol used for network mangement 简单

网络管理协议

snmptrap.exe > utility used with snmp snmp工具

sol.exe > windows solitaire game 纸牌

sort.exe > compares files and folders 读取输入、排序数据并将结果写到屏幕、文

件和其他设备上

SPOOLSV.EXE > Part of the spooler service for printing 打印池服务的一部分

sprestrt.exe >

srvmgr.exe > Starts the Windows Server Manager 服务器管理器

stimon.exe > WDM StillImage- > Monitor

stisvc.exe > WDM StillImage- > Service

subst.exe > Associates a path with a drive letter 将路径与驱动器盘符关联

svchost.exe > Svchost.exe is a generic host process name for services that a

re run from dynamic-link libraries (DLLs). DLL得主进程

syncapp.exe > Creates Windows Briefcase. 创建Windows文件包

sysedit.exe > Opens Editor for 4 system files 系统配置编辑器

syskey.exe > Encrypt and secure system database NT账号数据库按群工具

sysocmgr.exe > Windows 2000 Setup 2000安装程序

systray.exe > Starts the systray in the lower right corner. 在低权限运行syst

ray

macfile.exe > Used for managing MACFILES 管理MACFILES

magnify.exe > Used to magnify the current screen 放大镜

makecab.exe > MS Cabinet Maker 制作CAB文件

mdm.exe > Machine Debug Manager 机器调试管理

mem.exe > Display current Memory stats 显示内存状态

migpwd.exe > Migrate passwords. 迁移密码

mmc.exe > Microsoft Management Console 控制台

mnmsrvc.exe > Netmeeting Remote Desktop Sharing NetMeeting远程桌面共享

mobsync.exe > Manage Synchronization. 同步目录管理器

mountvol.exe > Creates, deletes, or lists a volume mount point. 创建、删除或

列出卷的装入点。

mplay32.exe > MS Media Player 媒体播放器

mpnotify.exe > Multiple Provider Notification application 多提供者通知应用程

mq1sync.exe >

mqbkup.exe > MS Message Queue Backup and Restore Utility 信息队列备份和恢复工

mqexchng.exe > MSMQ Exchange Connector Setup 信息队列交换连接设置

mqmig.exe > MSMQ Migration Utility 信息队列迁移工具

mqsvc.exe > ?

mrinfo.exe > Multicast routing using SNMP 使用SNMP多点传送路由

mscdexnt.exe > Installs MSCD (MS CD Extensions) 安装MSCD

msdtc.exe > Dynamic Transaction Controller Console 动态事务处理控制台

msg.exe > Send a message to a user local or remote. 发送消息到本地或远程客户

mshta.exe > HTML Application HOST HTML应用程序主机

msiexec.exe > Starts Windows Installer Program 开始Windows安装程序

mspaint.exe > Microsoft Paint 画板

msswchx.exe >

mstask.exe > Task Schedule Program 任务计划表程序

mstinit.exe > Task scheduler setup 任务计划表安装

narrator.exe > Program will allow you to have a narrator for reading. Micros

oft讲述人

nbtstat.exe > Displays protocol stats and current TCP/IP connections using N

BT 使用 NBT(TCP/IP 上的 NetBIOS)显示协议统计和当前 TCP/IP 连接。

nddeapir.exe > NDDE API Server side NDDE API服务器端

net.exe > Net Utility 详细用法看/?

net1.exe > Net Utility updated version from MS Net的升级版

netdde.exe > Network DDE will install itself into the background 安装自己到后

netsh.exe > Creates a shell for network information 用于配置和监控 Windows 2

000 命令行脚本接口。

netstat.exe > Displays current connections. 显示协议统计和当前的 TCP/IP 网络

连接。

nlsfunc.exe > Loads country-specific information 加载特定国家(地区)的信息。

Windows 2000 和 MS-DOS 子系统不使用该命令。接受该命令只是为了与 MS-DOS 文件兼

容。

notepad.exe > Opens Windows 2000 Notepad 记事本

nslookup.exe > Displays information for DNS 该诊断工具显示来自域名系统 (DNS)

名称服务器的信息。

ntbackup.exe > Opens the NT Backup Utility 备份和故障修复工具

ntbooks.exe > Starts Windows Help Utility 帮助

ntdsutil.exe > Performs DB maintenance of the ADSI 完成ADSI的DB的维护

ntfrs.exe > NT File Replication Service NT文件复制服务

ntfrsupg.exe >

ntkrnlpa.exe > Kernel patch 核心补丁

ntoskrnl.exe > Core NT Kernel KT的核心

ntsd.exe >

ntvdm.exe > Simulates a 16-bit Windows environment 模拟16位Windows环境

nw16.exe > Netware Redirector NetWare转向器

nwscript.exe > runs netware scripts 运行Netware脚本

odbcad32.exe > ODBC 32-bit Administrator 32位ODBC管理

odbcconf.exe > Configure ODBC driver's and data source's from command line 命

令行配置ODBC驱动和数据源

taskman.exe > Task Manager 任务管理器

taskmgr.exe > Starts the Windows 2000 Task Manager 任务管理器

tcmsetup.exe > telephony client wizard 电话服务客户安装

tcpsvcs.exe > TCP Services TCP服务

.exe > Telnet Utility used to connect to Telnet Server

termsrv.exe > Terminal Server 终端服务

tftp.exe > Trivial FTP 将文件传输到正在运行 TFTP 服务的远程计算机或从正在运行

TFTP 服务的远程计算机传输文件

tftpd.exe > Trivial FTP Daemon

themes.exe > Change Windows Themes 桌面主题

tlntadmn.exe > Telnet Server Administrator Telnet服务管理

tlntsess.exe > Display the current Telnet Sessions 显示目前的Telnet会话

tlntsvr.exe > Start the Telnet Server 开始Telnet服务

tracert.exe > Trace a route to display paths 该诊断实用程序将包含不同生存时间

(TTL) 值的 Internet 控制消息协议 (ICMP) 回显数据包发送到目标,以决定到达目标

采用的路由

tsadmin.exe > Terminal Server Administrator 终端服务管理器

tscon.exe > Attaches a user session to a terminal session. 粘贴用户会话到终端

对话

tsdiscon.exe > Disconnect a user from a terminal session 断开终端服务的用户

tskill.exe > Kill a Terminal server process 杀掉终端服务

tsprof.exe > Used with Terminal Server to query results. 用终端服务得出查询结

tsshutdn.exe > Shutdown the system 关闭系统

unlodctr.exe > Part of performance monitoring 性能监视器的一部分

upg351db.exe > Upgrade a jet database 升级Jet数据库

ups.exe > UPS service UPS服务

user.exe > Core Windows Service Windows核心服务

userinit.exe > Part of the winlogon process Winlogon进程的一部分

usrmgr.exe > Start the windows user manager for domains 域用户管理器

utilman.exe > This tool enables an administrator to designate which computers automatically open accessibility tools when Windows 2000 starts. 指定2000启动时自动打开那台机器

verifier.exe > Driver Verifier Manager Driver Verifier Manager

vwipxspx.exe > Loads IPX/SPX VDM 调用IPX/SPX VDM

w32tm.exe > Windows Time Server 时间服务器

wextract.exe > Used to extract windows files 解压缩Windows文件

winchat.exe > Opens Windows Chat 打开Windows聊天

winhlp32.exe > Starts the Windows Help System 运行帮助系统

winlogon.exe > Used as part of the logon process. Logon进程的一部分

winmine.exe > windows Game 挖地雷

winmsd.exe > Windows Diagnostic utility 系统信息

wins.exe > Wins Service Wins服务

winspool.exe > Print Routing 打印路由

winver.exe > Displays the current version of Windows 显示Windows版本

wizmgr.exe > Starts Windows Administration Wizards Windows管理向导

wjview.exe > Command line loader for Java 命令行调用Java

wowdeb.exe > . For starters, the 32-bit APIs require that the WOWDEB.EXE tas

k runs in the target debugee's VM 启动时,32位API需要

wowexec.exe > For running Windows over Windows Applications 在Windows应用程序

上运行Windows

wpnpinst.exe > ?

write.exe > Starts MS Write Program 写字板

wscript.exe > Windows Scripting Utility 脚本工具

wupdmgr.exe > Starts the Windows update Wizard (Internet) 运行Windows升级向导

xcopy.exe > 复制文件和目录,包括子目录