This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / 我想用SCRIPT自动从网站下载一个FILE存到LOCAL C:DRIVE,请问怎么实现,已经试了WGET, 不行。The link to the file I want to download is inside. Thanks much!http://www.treas.gov/offices/enforcement/ofac/sdn/delimit/sdn.del
-buickregal(Motion - Slow Cooker);
2009-1-28
{65}
(#5011345@0)
-
我是用.net的,用io函数stream直接写磁盘不行么。当然如果你是web程序估计不行,本地都有保护程序,限制浏览器自动下载
-vega_lee(天津包子-就不改);
2009-1-28
(#5011350@0)
-
只是一个小utility program., 有没有简单一点的, 用batch file 就最好了. 谢了
-buickregal(Motion - Slow Cooker);
2009-1-28
(#5011526@0)
-
Check .net WebClient class. I believe there are similar classes in java or PHP.
-deep_blue(BLUE);
2009-1-28
(#5011420@0)
-
只是一个小utility program, 有没有简单一点的, 用batch file 就最好了. 谢谢
-buickregal(Motion - Slow Cooker);
2009-1-28
(#5011527@0)
-
No. It's not simple function.
-deep_blue(BLUE);
2009-1-29
(#5012040@0)
-
我是用cygwin里自带的wget, 没有问题啊
-buma(四眼);
2009-1-28
{543}
(#5011449@0)
-
你什么wget啊,什么错误信息说来听听?
-buma(四眼);
2009-1-28
(#5011452@0)
-
Just tried with VPN in, still connect connect. Our company using proxy server for http connection. Looks like this is the problem. let me google to see if I can find using wget through proxy...c:\wget http://www.treas.gov/offices/enforcement/ofac/sdn/delimit/sdn.del
--2009-01-28 18:23:46-- http://www.treas.gov/offices/enforcement/ofac/sdn/delim
it/sdn.del
Resolving www.treas.gov... 66.77.70.101
Connecting to www.treas.gov|66.77.70.101|:80... failed: Connection timed out.
Retrying.
--2009-01-28 18:24:09-- (try: 2) http://www.treas.gov/offices/enforcement/ofac
/sdn/delimit/sdn.del
Connecting to www.treas.gov|66.77.70.101|:80... failed: Connection timed out.
Retrying.
-buickregal(Motion - Slow Cooker);
2009-1-28
{495}
(#5011523@0)
-
More detailed errors, How to proxy authentication problem?
-buickregal(Motion - Slow Cooker);
2009-1-28
{648}
(#5011674@0)
-
谢谢各位, 看来是我下载的wget有问题或者是公司Firewall block了, 重新从sourceforge上下了一个就可以了. 明天到公司再试一试, 如果不行还得想其他办法. 再次谢谢大家了!!
-buickregal(Motion - Slow Cooker);
2009-1-28
(#5011517@0)
-
firewall 如果block文件下载的话你是没办法,如果是公司内部proxy的话这样 wget --no-cache --proxy-user=yourproxyuserid --proxy-password=yourproxypassword theurlyouwant记得在.wgetrc里放上
‘http_proxy = URL’
‘https_proxy = URL’
‘ftp_proxy = URL’
‘no_proxy = string’
-buma(四眼);
2009-1-28
{108}
(#5011702@0)
-
Write a Java program, make URLConnection, get urlConn.getInputStream (), read line by line, save to local text file. EASY. If there is a proxy, use: urlConn = url.openConnection(myproxy)
-nicetomeetyou(_);
2009-1-28
(#5011693@0)
-
老牛写java写上瘾了么?
-buma(四眼);
2009-1-28
(#5011706@0)
-
Writing a management program for web session control. Some vars are session-persistent, some are request-persistent. Do you think storing those vars and attributes into database, and initiate them during session startup is a good idea?
-nicetomeetyou(_);
2009-1-28
(#5011793@0)
-
no idea, u need a database for this? I am kind of surprised, I would just read it from a flat session file when session is up and load the request-persistent session in the running process user space. .I don't actually know what you are referring to anyway
-buma(四眼);
2009-1-28
{55}
(#5011809@0)
-
flat file is ok, some conf files are xml files anyway, but I want to have the ability to control/monitor vars through remote connection, and have more potential to log precisely about what happens about id/session/request.I can save var definition in a file and then use admin session to dynamically create/modify vars in a hashmap, ...... another way to go when web app demands some off-line capacity.
-nicetomeetyou(_);
2009-1-28
{180}
(#5011831@0)
-
thanks for the input. Since our company use MS ISA proxy server, which uses a proprietary NTLM protocol which only allows MS product to connect ISA. So I figure out a lazy way to do it.c:>iexplore http://www.treas.gov/offices/enforcement/ofac/sdn/delimit/sdn.del
after that, just copy the sdn.del from temporary internet file folder to my c drive. theoretically it should work, will see. :)
-buickregal(Motion - Slow Cooker);
2009-1-29
{208}
(#5012012@0)
-
Here is the link to how to use NTLMAPS to solve the MS ISA authentication problem. Post here just in case someone else comes across same situation. Then I use wget to grab the file. Thanks all!
-buickregal(Motion - Slow Cooker);
2009-1-31
(#5016734@0)