url传递多个参数

longww0513 2011-07-20 03:23:12

string ip = lb1.Text;
string name = Username.Text;
Response.Redirect("http://localhost:3299/Message.aspx?name="+Server.UrlEncode(name));

这是单个参数的,我现在想再加上传送ip这个变量 该怎么做
...全文
597 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
xingxingbanyue 2011-07-20
  • 打赏
  • 举报
回复
2楼和6楼的合起来就很全了
SuperTyro 2011-07-20
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 highpr 的回复:]

C# code

string ip = lb1.Text;
string name = Username.Text;
Response.Redirect("http://localhost:3299/Message.aspx?name="+Server.UrlEncode(name)+"&ip="+ip);
[/Quote]

正解
qq346127416 2011-07-20
  • 打赏
  • 举报
回复
多参数 用 &分隔就可以了
longww0513 2011-07-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 yankai159357 的回复:]
http://localhost:3299/Message.aspx?name="+ip);
[/Quote]
这也只是传递了ip这一个参数啊 我想传递的是name和ip两个参数
  • 打赏
  • 举报
回复
http://localhost:3299/Message.aspx?name=张三&&ip=192.168.0.1&&参数名=参数
md5e 2011-07-20
  • 打赏
  • 举报
回复
string url="http://localhost:3299/Message.aspx?name={0}&ip={1}"
Response.Redirect(string.Format(url,Server.UrlEncode(name),Server.UrlEncode(ip)));

highpr 2011-07-20
  • 打赏
  • 举报
回复

string ip = lb1.Text;
string name = Username.Text;
Response.Redirect("http://localhost:3299/Message.aspx?name="+Server.UrlEncode(name)+"&ip="+ip);

随心录123 2011-07-20
  • 打赏
  • 举报
回复
http://localhost:3299/Message.aspx?name="+ip);

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧