StreamReader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This object works great with "files".

but I have a Virtual web Site under my main site that points to my file share.
Since this is secure, I'd like to open the file via its url.

I tried this but .net failed. Said URI formats are not supported!

string sFile = "https://myServer/Reports//12345/myfile.asp";
StreamReader oTextFile = new StreamReader(sFile);



Is it possible to use the StreamReader object on url files?

Thanks

Mike
 
Mike said:
This object works great with "files".

but I have a Virtual web Site under my main site that points to my file share.
Since this is secure, I'd like to open the file via its url.

I tried this but .net failed. Said URI formats are not supported!

string sFile = "https://myServer/Reports//12345/myfile.asp";
StreamReader oTextFile = new StreamReader(sFile);



Is it possible to use the StreamReader object on url files?


No, there are no "url files".
If you want to read from a HTTP or HTTPS URL then use
WebRequest.Create(@"https://example.com/dir/page.asp")
For simple things there is also WebClient
 
Martin

Do you have an example of how I can use WebRequest in conjunction with StreamReader to open the URI

I'm struggling here
 
Jay

Many thanks for the tip. In looking more closely at this object..

BTW... can you explain to me what an abstract class is and what it is such?
 
Back
Top