基本信息
源码名称:Ngrok调用CMD执行命令
源码大小:17.97M
文件格式:.rar
开发语言:C#
更新时间:2017-06-24
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍


 try
            {

                textBox4_TextChanged(this, e);
                if (comboBox1.Text == "HTTP转发")
                {
                    ccc = " -config ngrok.ini start sunny";
                }
                else
                {
                    ccc = " -config ngrok.ini start tcp";
                }
               
                // //textBox1.Text = (File.ReadAllText(@"C:\Program Files\ngrok.ini"));读取配置文件

                // // Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("sunny.exe");
                 p.StartInfo.FileName = @"C:\Program Files\sunny.exe";//zh
                // //e121fe9d2c5790a3 HTTP//  84a0509483d3263c TCP//
                p.StartInfo.Arguments = ccc;//启动参数
                p.StartInfo.UseShellExecute = true;//调用程序,显示窗口
                p.StartInfo.CreateNoWindow = true;
                p.Start();//启动         

            }
            catch { };

        }

        private void button3_Click(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            textBox4_TextChanged(this, e);
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            textBox4_TextChanged(this,e);
        }

        private void textBox4_TextChanged(object sender, EventArgs e)
        {
            if (comboBox1.Text== "HTTP转发")
            {
                string sdd = "server_addr: \"server.ngrok.cc:4443\"\nauth_token: \"" textBox1.Text "\"\ntunnels:\n  ";
                string http = "sunny:\n    subdomain: \"" textBox2.Text "\"\n    proto:\n     http: " textBox3.Text ":" textBox4.Text;
                string add = sdd http;
                File.WriteAllText("ngrok.ini", add);

            }
            else
            {
                string sdd = "server_addr: \"server.ngrok.cc:4443\"\nauth_token: \"" textBox1.Text "\"\ntunnels:\n  ";
                string http = "tcp:\n    remote_port: \"" textBox2.Text "\"\n    proto:\n     tcp: " textBox3.Text ":" textBox4.Text;
                string add = sdd http;
                File.WriteAllText("ngrok.ini", add);
            }
            
        }