473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

HttpWebRequest for local file?

Can I construct an HttpWebRequest with a local file
instead of a URL?

It seems like I remember doing this in Java with something
like "file:\\\myfile.txt" in place of the URL.

Thanks,

Drew

Nov 15 '05 #1
1 6315
You cannot construct an HttpWebRequest with a local file. However, you can
construct a WebRequest, which is actually a FileWebRequest.

WebRequest wr = WebRequest.Create(file:///c:/a.txt);
MessageBox.Show(wr.GetType().ToString());

This will throw up a messagebox that shows "System.Net.FileWebRequest"

-vJ

"Drew" <so*****@hotmail.com> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Can I construct an HttpWebRequest with a local file
instead of a URL?

It seems like I remember doing this in Java with something
like "file:\\\myfile.txt" in place of the URL.

Thanks,

Drew

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JohnLH | last post by:
Hi, I am having an issue with the LOAD DATA LOCAL FILE command on the latest 3.0.9 JDBC Driver. The command works on Windows, but doesn't seem to work on OSX and Linux. The error that I get on...
20
by: Steve | last post by:
I have a web app that needs to parse through a file that is located on the client machine. I get the file string from a query string & then parse it. It is working fine on my development box but...
3
by: Christopher D. Wiederspan | last post by:
I've got a WebBrowser control in a C# Windows form. I build HTML on the fly and then set it into the control using the DocumentText property of the control. All of this works fine, except that part...
2
by: Savane78 | last post by:
Hi all, I'm just wondering if it is possible to upload a local file (using a <input file> but instead of just sending it, applying a treatment (encoding) to the file while sending it. ...
3
by: Daniel | last post by:
Is it possible to retain local file system read, write, delete access while impersonating for access to a remote drive in a different domain? I need to be able to move files from a local computer...
2
by: Peter White | last post by:
I am trying to transfer a file from a user's local machine (the file is automatically created by a 3rd party tool and stored in the users local settings/temp directory) via a web form to my web...
5
by: acord | last post by:
Hi, Can anyone tell me how to use XMLHTTPRequest or MS ActivcXObject open a local file? Thanks Sam
5
by: timnels | last post by:
I have a web browser control that I'd like to point at a HTML file in my installation directory. I am doing something like: string path = Path.GetDirectoryName(...
8
by: martinsmith160 | last post by:
Hi everyone I am trying to create a simple wpf program that allows a user to select an image from a combo box and then where they click on th screen draw that image at the mouse co-ordinates. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.