I
Isaac Martinez
Hello all,
I have to make a small app that will do the following.
1. Connect to a webserver and get a directory listing.
2. I have to download each file in the specified directory.
3. Once the file is downloaded, enter the data into a SQL2k database.
4. After the file is parsed, I have to delete the file.
I was able to successfully complete steps 1-3 using the
System.Net.WebClient class. Step #4 is somewhat difficult because there's
no file delete method in the WebClient class.
Using network monitor I was able to sniff out the HTTP command that would
allow file deletion.
----------------------------------------------------
DELETE filename.txt
HTTP/1.1
Accept-Language: en-us
Destroy: NoUndelete
Translate: f
User-Agent: Microsoft Data Access Internet Publishing Provider DAV 1.1
Host: 192.168.XXX.XXX
Content-Length: 0
Connection: Keep-Alive
----------------------------------------------------
My question is the following: Is there anyway to post HTTP commands using
the .Net Framework?
Thanks,
Isaac
I have to make a small app that will do the following.
1. Connect to a webserver and get a directory listing.
2. I have to download each file in the specified directory.
3. Once the file is downloaded, enter the data into a SQL2k database.
4. After the file is parsed, I have to delete the file.
I was able to successfully complete steps 1-3 using the
System.Net.WebClient class. Step #4 is somewhat difficult because there's
no file delete method in the WebClient class.
Using network monitor I was able to sniff out the HTTP command that would
allow file deletion.
----------------------------------------------------
DELETE filename.txt
HTTP/1.1
Accept-Language: en-us
Destroy: NoUndelete
Translate: f
User-Agent: Microsoft Data Access Internet Publishing Provider DAV 1.1
Host: 192.168.XXX.XXX
Content-Length: 0
Connection: Keep-Alive
----------------------------------------------------
My question is the following: Is there anyway to post HTTP commands using
the .Net Framework?
Thanks,
Isaac