Console.Clear Method (System)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kerry Brown

    Console.Clear Method (System)

    Using Microsoft Visual C# 2005 Express [2.0.50215]
    With XP Pro

    Console.Clear() ;
    used as per the the sample at
    Clears the console buffer and corresponding console window of display information.


    is throwing an exception :
    System.IO.IOExc eption was unhandled
    Message="The handle is invalid.\r\n"
    Source="mscorli b"
    StackTrace:
    at System.IO.__Err or.WinIOError(I nt32 errorCode, String
    maybeFullPath)

    at System.Console. GetBufferInfo(B oolean throwOnNoConsol e, Boolean&
    succeeded)

    at System.Console. GetBufferInfo()

    at System.Console. Clear()

    at TestClear.Progr am.Main(String[] args) in
    C:\VCSharp\kwb_ testing\TestCle ar\TestClear\Pr ogram.cs:line 34

    at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[]
    args)

    at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
    assemblySecurit y, String[] args)

    at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()

    at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)

    at System.Threadin g.ExecutionCont ext.Run(Executi onContext
    executionContex t, ContextCallback callback, Object state)

    at System.Threadin g.ThreadHelper. ThreadStart()

    ... Can anyone throw some light on this ??
    Regards
    Kerry


  • Willy Denoyette [MVP]

    #2
    Re: Console.Clear Method (System)


    "Kerry Brown" <kwbrown@home > wrote in message
    news:epQqrduRFH A.3356@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Using Microsoft Visual C# 2005 Express [2.0.50215]
    > With XP Pro
    >
    > Console.Clear() ;
    > used as per the the sample at
    > http://msdn2.microsoft.com/library/2...us,vs.80).aspx
    >
    > is throwing an exception :
    > System.IO.IOExc eption was unhandled
    > Message="The handle is invalid.\r\n"
    > Source="mscorli b"
    > StackTrace:
    > at System.IO.__Err or.WinIOError(I nt32 errorCode, String
    > maybeFullPath)
    >
    > at System.Console. GetBufferInfo(B oolean throwOnNoConsol e, Boolean&
    > succeeded)
    >
    > at System.Console. GetBufferInfo()
    >
    > at System.Console. Clear()
    >
    > at TestClear.Progr am.Main(String[] args) in
    > C:\VCSharp\kwb_ testing\TestCle ar\TestClear\Pr ogram.cs:line 34
    >
    > at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[]
    > args)
    >
    > at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
    > assemblySecurit y, String[] args)
    >
    > at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
    >
    > at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
    >
    > at System.Threadin g.ExecutionCont ext.Run(Executi onContext
    > executionContex t, ContextCallback callback, Object state)
    >
    > at System.Threadin g.ThreadHelper. ThreadStart()
    >
    > ... Can anyone throw some light on this ??
    > Regards
    > Kerry
    >[/color]


    Please post Beta2 questions to the VS2005 Beta forum
    http://forums.microsoft.com/msdn/ , these forums are meant to support
    customers for the Visual Studio 2005 Beta 2 release and are replacing the
    private whidbey NG's.

    That said , the sample you are refering to works for me, I guess you run a
    modified version.

    Willy.



    Comment

    Working...