I have written the function:
Which opens and reads in a file on the internet.Code:Public Function getInternetFile(ByVal fileURL As String) As String Dim webconnect As New Net.WebClient() Dim readFileURL As New IO.StreamReader(webconnect.OpenRead(fileURL)) Dim fileInternetContents As String = readFileURL.ReadToEnd readFileURL.Close() webconnect.Dispose() Return fileInternetContents End Function
How do i add an error message. ie if the function is called but the fileURL value dosent exsist, then I want it to return an error message. At the moment it will just crash if fileURL is invalid!
THanks!


Reply With Quote