以编程方式使用凭据C#登录HTTPS网站 [英] Programmatically login to HTTPS website with credentials C#

查看:76
本文介绍了以编程方式使用凭据C#登录HTTPS网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,
我正在使用C#中的凭证信息访问网站。供应商网站不提供任何类型的Web服务来连接到他们的网站。我只在网站上有URL名称,端口号,用户名,密码详细信息。有这些细节我可以编写一个发布HTTPwebrequest的C#rogram吗?我可以获得一个webresponse作为回报吗?登录后我必须从可用的文件夹中下载文件。
感谢您的回复。

Hi guys,

I'm tyring to accessa  website with credential info in C#. The vendor website does not offer any sort of web service to connect to theiir website.  I only have URL name, port number, user name, password details abt the website.  with these details Can I write a C# rogram that will post a HTTPwebrequest and can I get a webresponse in return?  Agfter I login I have to download a file from the folders available.
Appreciate your responses.

推荐答案

Hi Tech_geek,

在第一次Http请求之前,您可以设置 HttpWebRequest 凭据属性以在此方案中提供用户凭据。试试这个。

里克尔
Hi Tech_geek,

Before you first Http request, you can set the HttpWebRequest. Credentials property to supply user credential in this scenario. Try this.

Riquel


这篇关于以编程方式使用凭据C#登录HTTPS网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆