VB.Net by API/System.Diagnostics/Debug — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 12:50, 26 мая 2010
Содержание
Debug.Assert
Imports System.IO
Module Module1
Sub Main()
Dim FileStr As StreamWriter
System.Diagnostics.Debug.Assert(Not (FileStr Is Nothing), "FileStr is NULL")
System.Diagnostics.Debug.Assert(Directory.Exists("\Temp"), "\Temp does not exist")
End Sub
End Module
Debug.AutoFlush
Imports System.IO
Imports System.Diagnostics
Module Module1
Sub Main()
Dim Str As New FileStream("C:\DebugMessages.txt", System.IO.FileMode.Append)
Dim DebugFile As New StreamWriter(Str)
Dim Listener = New TextWriterTraceListener(DebugFile)
Debug.Listeners.Add(Listener)
Debug.AutoFlush = True
Debug.WriteLine("")
Debug.WriteLine("Messages generated at " & Now())
Debug.WriteLine("In Button Click")
Debug.WriteLine("Calling First")
First()
Debug.WriteLine("Exiting Button Click")
Debug.Listeners.Remove(Listener)
Str.Close()
End Sub
Private Sub First()
Debug.WriteLine("In First")
Debug.WriteLine("Calling Second")
Second()
Debug.WriteLine("Back in First")
End Sub
Private Sub Second()
Debug.WriteLine("In Second")
End Sub
End Module
Debug.Listeners
Imports System.IO
Imports System.Diagnostics
Module Module1
Sub Main()
Dim Str As New FileStream("C:\DebugMessages.txt", System.IO.FileMode.Append)
Dim DebugFile As New StreamWriter(Str)
Dim Listener = New TextWriterTraceListener(DebugFile)
Debug.Listeners.Add(Listener)
Debug.AutoFlush = True
Debug.WriteLine("")
Debug.WriteLine("Messages generated at " & Now())
Debug.WriteLine("In Button Click")
Debug.WriteLine("Calling First")
First()
Debug.WriteLine("Exiting Button Click")
Debug.Listeners.Remove(Listener)
Str.Close()
End Sub
Private Sub First()
Debug.WriteLine("In First")
Debug.WriteLine("Calling Second")
Second()
Debug.WriteLine("Back in First")
End Sub
Private Sub Second()
Debug.WriteLine("In Second")
End Sub
End Module
Debug.Listeners.Remove
Imports System.IO
Imports System.Diagnostics
Module Module1
Sub Main()
Dim Str As New FileStream("C:\DebugMessages.txt", System.IO.FileMode.Append)
Dim DebugFile As New StreamWriter(Str)
Dim Listener = New TextWriterTraceListener(DebugFile)
Debug.Listeners.Add(Listener)
Debug.AutoFlush = True
Debug.WriteLine("")
Debug.WriteLine("Messages generated at " & Now())
Debug.WriteLine("In Button Click")
Debug.WriteLine("Calling First")
First()
Debug.WriteLine("Exiting Button Click")
Debug.Listeners.Remove(Listener)
Str.Close()
End Sub
Private Sub First()
Debug.WriteLine("In First")
Debug.WriteLine("Calling Second")
Second()
Debug.WriteLine("Back in First")
End Sub
Private Sub Second()
Debug.WriteLine("In Second")
End Sub
End Module
Debug.WriteLine
Imports System.IO
Imports System.Diagnostics
Module Module1
Sub Main()
Dim Str As New FileStream("C:\DebugMessages.txt", System.IO.FileMode.Append)
Dim DebugFile As New StreamWriter(Str)
Dim Listener = New TextWriterTraceListener(DebugFile)
Debug.Listeners.Add(Listener)
Debug.AutoFlush = True
Debug.WriteLine("")
Debug.WriteLine("Messages generated at " & Now())
Debug.WriteLine("In Button Click")
Debug.WriteLine("Calling First")
First()
Debug.WriteLine("Exiting Button Click")
Debug.Listeners.Remove(Listener)
Str.Close()
End Sub
Private Sub First()
Debug.WriteLine("In First")
Debug.WriteLine("Calling Second")
Second()
Debug.WriteLine("Back in First")
End Sub
Private Sub Second()
Debug.WriteLine("In Second")
End Sub
End Module