如何在C#.net中更改HttpWebRequest的地址 [英] How to change the address of the HttpWebRequest in C#.net

查看:76
本文介绍了如何在C#.net中更改HttpWebRequest的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的代码如下



string url =http:/ /localhost:2002/Application/Newpage.aspx;





HttpWebRequest requestIP =(HttpWebRequest)WebRequest.Create(url)



i需要加载网址。



但是自动将默认页面作为主页。< br $>




requestIP.address =http:// localhost:2002 / Application / Default.aspx



i需要更改此requestIp.address = url;



但它显示错误,因为requestIP是只读

Hi All,

I have code as below

string url="http://localhost:2002/Application/Newpage.aspx";


HttpWebRequest requestIP = (HttpWebRequest)WebRequest.Create(url)

i Need given url to be loaded .

But automatically it took the default page as a home page.


requestIP.address="http://localhost:2002/Application/Default.aspx"

i need to change this requestIp.address=url;

but it shows error as requestIP is Read only

推荐答案

请参阅 MSDN [ ^ ]


这篇关于如何在C#.net中更改HttpWebRequest的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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