回复 11# idwma
我在ISE中试的好像是死循环, 报下面的错
>Exception calling "SetCursorPosition" with "2" argument(s): "句柄无效。
"
At line:16 char:5
+ [Console]::SetCursorPosition(0,$mod)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( [], MethodInvocationException
+ FullyQualifiedErrorId : IOException
Exception calling "ReadKey" with "1" argument(s): "Cannot read keys when either application does not have a console or when console input has been redirected from a file
. Try Console.Read."
At line:9 char:5
+ $i=[int][Console]::ReadKey(1).key
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : InvalidOperationException
Exception calling "SetCursorPosition" with "2" argument(s): "句柄无效。
"
At line:14 char:5
+ [Console]::SetCursorPosition(0,$mod)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IOException
>Exception calling "SetCursorPosition" with "2" argument(s): "句柄无效。
"
At line:16 char:5
+ [Console]::SetCursorPosition(0,$mod)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : IOException |