Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Try and Cash...
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00612435
Message ID:
00612618
Views:
21
This message has been marked as the solution to the initial question of the thread.
This is from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthrowingexceptions.asp
   Public Shared Sub Main()
      Try
         'Opens a text file.
         Dim fs As New FileStream("data.txt", FileMode.Open)
         Dim sr As New StreamReader(fs)
         Dim line As String
         'A value is read from the file and output to the console.
         line = sr.ReadLine()
         Console.WriteLine(line)
      Catch e As FileNotFoundException
         Console.WriteLine("[Data File Missing] {0}", e)
         Throw New FileNotFoundException("[data.txt not in c:\dev directory]", e)
      Finally
         fs.Close()
      End Try
   End Sub 'Main
-Dave


>Can you give me a example of how you use this command in VB.net?
>
>>>In C# you can use the Try can Cash command.
>>>
>>>Does VB.Net have the same command?
>>
>>
>>Try can Cash ?
>>Or Try, Catch, Finally ?
>>
>>:-)
>>
>>Yes, it's in VB.
Previous
Reply
Map
View

Click here to load this message in the networking platform