chpmould 发表于 2010-11-27 18:18:00

控制命令行的回显

<p>请教了</p>
<p>C#如何控制命令行回显的开和关</p>

雪山飞狐_lzh 发表于 2010-11-27 21:37:00

<p>cmdecho系统变量</p>
<p>&nbsp;</p>
<p><font face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// 控制命令行回显<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;/summary&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static bool CmdEcho<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (int)Application.GetSystemVariable("cmdecho") == 1;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.SetSystemVariable("cmdecho", Convert.ToInt16(value));<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font></p>

chpmould 发表于 2010-11-28 08:57:00

本帖最后由 chpmould 于 2010-11-29 19:41 编辑 <br /><br /><P>谢谢,问题已解决...</P>
<P>另请教LISP中蒱捉<FONT face=Verdana>(setvar "osmode" 0)开和关如何写...</FONT></P>

雪山飞狐_lzh 发表于 2010-11-28 10:05:00

<p>Application.GetSystemVariable("osmode");</p>
<p>Application.SetSystemVariable("osmode", ival);</p>

chpmould 发表于 2010-11-28 10:34:00

本帖最后由 chpmould 于 2010-11-29 19:40 编辑 <br /><br /><DIV id=textstyle_4 style="FONT-SIZE: 12pt; OVERFLOW: hidden; WORD-BREAK: break-all; TEXT-INDENT: 0px; WORD-WRAP: break-word">
<P>狐哥,再请教了</P>
<P>Application.GetSystemVariable("osmode");这句是什么意思,怎么用的</P>
<P>&nbsp;</P></DIV>

雪山飞狐_lzh 发表于 2010-11-28 10:47:00

<pre class="Element100"><strong><div class="Element5">Application.GetSystemVariable Method</div></strong></pre><pre class="Element100"><strong>public</strong> <strong>static</strong> <strong>object</strong> <strong>GetSystemVariable</strong>(
    <strong>string</strong> <strong>name</strong>
);</pre>
<p>
<table class="Table2" cellspacing="0">
<tbody>
<tr>
<td class="Element242" valign="top" width="50%">
<div class="Element243">string name&nbsp;</div></td>
<td class="Element246" valign="top" width="50%">
<div class="Element247">Input the name of the system variable to get.&nbsp;</div></td></tr></tbody></table></p>
<p>&nbsp;</p>
<p class="Element10">Returns the system variable.</p>

chpmould 发表于 2010-11-28 10:56:00

谢谢,我明白了。。。

yxr_MJTD 发表于 2010-11-29 17:00:17

谢谢,我也明白了.
页: [1]
查看完整版本: 控制命令行的回显