{"id":313,"date":"2014-06-15T18:48:33","date_gmt":"2014-06-15T09:48:33","guid":{"rendered":"https:\/\/prg.waou.biz\/?p=313"},"modified":"2018-03-03T08:36:57","modified_gmt":"2018-03-02T23:36:57","slug":"%e3%83%ac%e3%82%b8%e3%82%b9%e3%83%88%e3%83%aa%e3%81%a7%e5%8f%b3%e3%82%af%e3%83%aa%e3%83%83%e3%82%af%e3%83%a1%e3%83%8b%e3%83%a5%e3%81%ab%e8%bf%bd%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/prg.waou.biz\/?p=313","title":{"rendered":"\u30ec\u30b8\u30b9\u30c8\u30ea\u3067\u53f3\u30af\u30ea\u30c3\u30af\u30e1\u30cb\u30e5\u306b\u8ffd\u52a0"},"content":{"rendered":"\n<pre class=\"lang:default decode:true \" >private string LoadSart()\r\n{\r\nstring str= System.Environment.CommandLine;\r\nstr= Syste\r\nm.Text.RegularExpressions.Regex.Replace(str, \"\\\".+\\\"\",\"\").Trim();\r\n\r\n\/\/ noby.Message(str);\r\n\r\n\/\/ listBox1.Items.Add(str);\r\n\/\/\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3092\u914d\u5217\u3067\u53d6\u5f97\u3059\u308b\r\n\/\/string[] cmds;\r\n\/\/cmds = System.Environment.GetCommandLineArgs();\r\n\r\n\/\/ pnlCenter2_Setting.Visible = true;\r\n\r\n\/\/\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306e\u8868\u793a\r\n\/\/for (int index = 1; index &lt; cmds.Length; index++)\r\n\/\/{\r\n\/\/ \/\/listBox1.Items.Add(cmds[index]);\r\n\r\n\/\/ string cmd = cmds[index];\r\n\/\/ str +=\" \"+cmd;\r\n\/\/}\r\n\r\ntry\r\n{\r\n\r\n\/\/\u5b9f\u884c\u3059\u308b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\r\nstring commandline = \"\\\"\" + Application.ExecutablePath + \"\\\" %1\";\r\nstring commandline2 = \"\\\"\" + Application.ExecutablePath + \"\\\" %V\";\r\nstring commandline3 = \"\\\"\" + Application.ExecutablePath + \"\\\",0\";\r\n\r\n\/\/\u8aac\u660e\uff08\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc\u306b\u8868\u793a\u3055\u308c\u308b\uff09\r\n\r\n\/\/\u500b\u3005\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\r\nRegistryKey regVersion = Registry.ClassesRoot.OpenSubKey(\"*\\\\shell\\\\\" + gro.productName + \"\\\\command\");\r\n\r\n\/\/\u30d5\u30a9\u30eb\u30c0\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\r\nRegistryKey regVersion2= Registry.ClassesRoot.OpenSubKey(\"Folder\\\\shell\\\\\" + gro.productName + \"\\\\command\");\r\n\r\n\/\/\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u4f59\u767d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\r\nRegistryKey regVersion3 = Registry.ClassesRoot.OpenSubKey(\"Directory\\\\Background\\\\shell\\\\\" + gro.productName + \"\\\\command\");\r\n\r\nif (regVersion == null)\r\n{\r\n\r\nconst string regFn = \"*\\\\shell\\\\\" + gro.productName;\r\n\r\n\/\/\u30d5\u30a9\u30eb\u30c0\u3078\u306e\u95a2\u9023\u4ed8\u3051\u3092\u884c\u3046\r\nRegistryKey regkey =Registry.ClassesRoot.CreateSubKey(regFn+\"\\\\command\");\r\nif (regkey != null) regkey.SetValue(\"\", commandline);\r\n\r\nregkey =Registry.ClassesRoot.CreateSubKey(regFn);\r\n\r\nif (regkey != null)regkey.SetValue(\"Icon\", commandline3);\r\n\r\nif (regkey != null) regkey.Close();\r\n\r\n}\r\n\r\nif (regVersion2 == null)\r\n{\r\n\r\nconst string regFn = \"Folder\\\\shell\\\\\" + gro.productName;\r\n\r\n\/\/\u30d5\u30a9\u30eb\u30c0\u3078\u306e\u95a2\u9023\u4ed8\u3051\u3092\u884c\u3046\r\nRegistryKey regkey = Registry.ClassesRoot.CreateSubKey(regFn + \"\\\\command\");\r\nif (regkey != null) regkey.SetValue(\"\", commandline);\r\n\r\nregkey = Registry.ClassesRoot.CreateSubKey(regFn);\r\n\r\nif (regkey != null) regkey.SetValue(\"Icon\", commandline3);\r\n\r\nif (regkey != null) regkey.Close();\r\n\r\n}\r\n\r\nif (regVersion3 == null)\r\n{\r\n\r\nconst string regFn = \"Directory\\\\Background\\\\shell\\\\\" + gro.productName;\r\n\r\n\/\/\u30d5\u30a9\u30eb\u30c0\u3078\u306e\u95a2\u9023\u4ed8\u3051\u3092\u884c\u3046\r\nRegistryKey regkey = Registry.ClassesRoot.CreateSubKey(regFn + \"\\\\command\");\r\nif (regkey != null) regkey.SetValue(\"\", commandline2);\r\n\r\nregkey = Registry.ClassesRoot.CreateSubKey(regFn);\r\n\r\nif (regkey != null) regkey.SetValue(\"Icon\", commandline3);\r\n\r\nif (regkey != null) regkey.Close();\r\n\r\n}\r\n\r\n}\r\ncatch (Exception d)\r\n{\r\n\/\/ noby.Message(d.ToString());\r\nRestartApplication();\r\n\r\n}\r\n\r\n\/\/\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u304c\u3042\u308b\u3068\u304d\r\nif (str != \"\")\r\n{\r\ngro.mEthod = gro.MethodFromFolder;\r\n\r\n\/\/ \u62e1\u5f35\u5b50\u304c\u5b58\u5728\u3057\u3066\u3044\u308c\u3070\u30d5\u30a9\u30eb\u30c0\u540d\u306e\u307f\u3092\u5f97\u308b\r\nif (Path.GetExtension(str) != \"\")\r\nstr = Path.GetDirectoryName(str);\r\n\r\nstring[] fileName = new string[1] { str };\r\n\r\nFolderBegin(fileName);\r\n\r\n}\r\n\r\nreturn Environment.CommandLine;\r\n\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>private string LoadSart() { string str= System.Environment.CommandLine; str= Syste m.Text.RegularExpressions.R [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_lightning_design_setting":[],"footnotes":""},"categories":[11],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313"}],"version-history":[{"count":3,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":825,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions\/825"}],"wp:attachment":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}