在IE中運行URL「http:// localhost /?Id = User1」時,ApplicationDeployment.CurrentDeployment.ActivationUri.Query返回「?Id = User1」,沒錯。爲什麼ActivationUri使用Chrome瀏覽器爲空?
在Chrome中運行URL「http:// localhost /?Id = User1」時,ApplicationDeployment.CurrentDeployment.ActivationUri爲空,爲什麼?如何解決這個問題?
下面是代碼:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Deployment;
using System.Deployment.Application;
namespace COSample
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (ApplicationDeployment.IsNetworkDeployed)
{
MessageBox.Show("Network");
MessageBox.Show(ApplicationDeployment.CurrentDeployment.ActivationUri.Query);
}
else
MessageBox.Show("Local");
Application.Run(new Form1());
}
}
}
你可以在上面的語句中顯示sorrounding代碼嗎? – ryadavilli
我添加了示例代碼,謝謝。 – ldlchina