Dotnet "system.net.webClient" download file?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2013   #1
Dotnet "system.net.webClient" download file?

Hi,
Does anyone know how to use system.net.webClient to download file?after searched forum,found this topic shows infomation about how to handle web events:
http://forums.cgsociety.org/showthread.php?t=855694
but i want to download a page content,so how can i do that?
Code:
request = (dotNetClass "system.Net.WebRequest").create "http://www.google.com" request.Credentials = (dotnetClass "System.Net.CredentialCache").DefaultCredentia ls response = request.GetResponse() --download content ...
 
Old 09 September 2013   #2
Quote:
Originally Posted by momo2012
Hi,
Does anyone know how to use system.net.webClient to download file?after searched forum,found this topic shows infomation about how to handle web events:
http://forums.cgsociety.org/showthread.php?t=855694
but i want to download a page content,so how can i do that?
Code:
request = (dotNetClass "system.Net.WebRequest").create "http://www.google.com" request.Credentials = (dotnetClass "System.Net.CredentialCache").DefaultCredentia ls response = request.GetResponse() --download content ...



sorry,double post
 
Old 09 September 2013   #3
Code:
wc = dotnetobject "System.Net.WebClient" wc.downloadFile <uri> <localfile> wc.dispose()
 
Old 09 September 2013   #4
Quote:
Originally Posted by lo
Code:
wc = dotnetobject "System.Net.WebClient" wc.downloadFile <uri> <localfile> wc.dispose()

Oh,thanks lo,I tried this way to download file before,the important thing is ,this way cannot use "timeout" command,but "system.Net.WebRequest" can ,does "System.Net.WebClient" can timeout too?
Or a way to download file with "system.Net.WebRequest" ?
Code:
--m=url request = (dotNetClass "system.Net.WebRequest").create m request.Timeout = 1000 --...
 
Old 09 September 2013   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:11 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.