c********e 发帖数: 28 | 1 I got a url of a file which is https. I want to write an application in C#
to download this file. I know how to do if it is http. But i cannot do it
with this https url because of 401 error. The thing is if I log in the
website, and paste the url then i can download it. My question is how can I
do it in a C# application?
Any help is highly appreciated! | c**t 发帖数: 2744 | 2 Check ip*works SSL. Or use curl.. | c********e 发帖数: 28 | 3 谢谢.下了curl, 不好意思,新手一个,没弄懂怎么在我的C# application里用.
不过现在用了个mshtml的东西,就是弄了个web browser automation,自动登陆到网站,
然后再run一个个https.
可是现在的问题是,browser跳出来的SAVE AS DIALOG ,怎么样automate?
有人说用Win32 API’s FindWindow() and SendMessage() and WM_SETTEXT to
programmatically assign a new file name.
.net本身有没有更好的办法呢?
【在 c**t 的大作中提到】 : Check ip*works SSL. Or use curl..
| a9 发帖数: 21638 | 4 建一个类
public class CertificatePolicy:System.Net.ICertificatePolicy
{
public CertificatePolicy()
{
//
// TODO: Add constructor logic here
//
}
#region ICertificatePolicy Members
public bool CheckValidationResult(System.Net.ServicePoint
srvPoint, System
.Security.Cryptography.X509Certificates.X509Certificate certificate, System.
Net.WebReque
【在 c********e 的大作中提到】 : 谢谢.下了curl, 不好意思,新手一个,没弄懂怎么在我的C# application里用. : 不过现在用了个mshtml的东西,就是弄了个web browser automation,自动登陆到网站, : 然后再run一个个https. : 可是现在的问题是,browser跳出来的SAVE AS DIALOG ,怎么样automate? : 有人说用Win32 API’s FindWindow() and SendMessage() and WM_SETTEXT to : programmatically assign a new file name. : .net本身有没有更好的办法呢?
| j********g 发帖数: 88 | 5 那个save as要访问本地文件系统的,不让automate
你可以用htmldocument的IPersistSteamInit接口访问html内容 |
|