且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

登录并使用C#检索嵌入表单页面数据

更新时间:2023-12-01 16:05:34

您的表单数据不正确。删除&放后,在开始它为我工作:

Your form data is incorrect. After removing the & at the beginning it worked for me:

sw.Write(string.Format("loginname={0}&password={1}&btnSubmit=Log In&institutioncode=H4V9KLUT45AV&version=2", Username, PassWord));

此外,如在其他答案已经提到的,您需要添加返回 ASPSESSIONIDs-s-rRDRST cookie的进一步请求到该网站。

Additionally, as already mentioned in the other answer, you need to add the returned ASPSESSIONIDs-s-rRDRST cookie in further requests to the site.