メール
外出ばかりで、ほとんど会社に行ってなかったらメールが300通たまっていた。中国語風のメールが実は日本語だったことが判明したが、原因も対応方法も不明。
ClickOnceで引数をとる方法。
まず、System.Deploymentを参照追加し、System.Deployment.Applicationをusingする。 applicationファイルのdeploymentタグに trustURLParameters="true"を追加。 VS 2005 ToolのVSコマンドプロンプトからMageUIを起動して修正してもよい。
public string[] GetArg() { if (!ApplicationDeployment.IsNetworkDeployed) return DelOne(Environment.GetCommandLineArgs()); string[] ss = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData; return ss == null ? new string[0] : ss[0].Split('&'); } public string[] DelOne(string[] ss) { if (ss == null || ss.Length == 0) return new string[0]; string[] res = new string[ss.Length - 1]; for (int i = 0; i < res.Length; ++i) res[i] = ss[i + 1]; return res; }
これが何故かうまくいかない。
ApplicationDeployment.CurrentDeployment.Update()やApplication.Restart()というのもある。