调用ClickOnce部署的应用程序的怪异问题
时间:2011-12-05
来源:互联网
提要:
1、我使用ClickOnce部署了一个应用程序,发布时采用允许给应用程序传递URL参数,并在测试窗体中,使用System.Deployment.Application.ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString方法来获取激活该应用程序的URL地址。该应用程序发布的访问位置为:http://localhost/ckTest/ckTest.application
2、我使用一个测试的website,在启动页面中放置了一个按钮,按钮的事件处理如下:
C# code
3、我的website访问的地址为:http://localhost/webTest/Default.aspx
问题来了:
通过访问http://localhost/webTest/Default.aspx,点击页面按钮,启动ckTest应用程序,获得的
ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString为:http://localhost/ckTest/ckTest.application?idcard=111,一切正常,OK。
然后,在Default页面的Load事件中也加入了如下处理代码:
C# code
通过访问http://localhost/webTest/Default.aspx,启动了ckTest应用程序,获得的
ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString为:http://localhost/webTest/Default.aspx,而不是http://localhost/ckTest/ckTest.application?idcard=111,让我很纳闷。
请高手释疑!!!
ps:我用的是VS2005,想实现的是,通过一个页面后台获取需要传递的参数,然后传给应用程序使用,不需要通过按钮点击事件,而是自动跳转的方式。
1、我使用ClickOnce部署了一个应用程序,发布时采用允许给应用程序传递URL参数,并在测试窗体中,使用System.Deployment.Application.ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString方法来获取激活该应用程序的URL地址。该应用程序发布的访问位置为:http://localhost/ckTest/ckTest.application
2、我使用一个测试的website,在启动页面中放置了一个按钮,按钮的事件处理如下:
C# code
protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("http://localhost/ckTest/ckTest.application?idcard=111"); }
3、我的website访问的地址为:http://localhost/webTest/Default.aspx
问题来了:
通过访问http://localhost/webTest/Default.aspx,点击页面按钮,启动ckTest应用程序,获得的
ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString为:http://localhost/ckTest/ckTest.application?idcard=111,一切正常,OK。
然后,在Default页面的Load事件中也加入了如下处理代码:
C# code
protected void Page_Load(object sender, EventArgs e) { Response.Redirect("http://localhost/ckTest/ckTest.application?idcard=111"); }
通过访问http://localhost/webTest/Default.aspx,启动了ckTest应用程序,获得的
ApplicationDeployment.CurrentDeployment.ActivationUri.OriginalString为:http://localhost/webTest/Default.aspx,而不是http://localhost/ckTest/ckTest.application?idcard=111,让我很纳闷。
请高手释疑!!!
ps:我用的是VS2005,想实现的是,通过一个页面后台获取需要传递的参数,然后传给应用程序使用,不需要通过按钮点击事件,而是自动跳转的方式。
作者: mxchbl 发布时间: 2011-12-05
没有高手啊。。。。。
作者: mxchbl 发布时间: 2011-12-14
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28