Rupert

::Me(C#,VC,MonoTouch,MonoforAndroid);

导航

2013年9月11日

摘要: 因为工作需要,需要用程序来控制VPN代理,在google搜了搜,还有不少朋友有同样的需求,但是目前在网上搜索到的解决方案,都还遗留了一些问题。只好自己手动把方案补齐了一下,谈不上原创,大牛们飘过就行。先谈谈自己的需求吧,就是针对如图示中的VPN连接,咱们至少需要以下四个基本功能1.新建一个VPN2.修改指定名字VPN的主机IP地址3.监视当前连接状态4.删除指定名称的VPN直接上代码吧,这里面引用了【DotRas.dll】 大家可以到官网http://dotras.codeplex.com/下载using System;using System.Collections.Generic;usin 阅读全文

posted @ 2013-09-11 16:43 ArRan 阅读(181) 评论(0) 推荐(0) 编辑

摘要: 很简单的代码就可以实现C#调用EXE文件,如下:引入using System.Diagnostics;调用代码:Process.Start(exe文件名);或直接System.Diagnostics.Process.Start(exe文件名);C#如何判断程序调用的exe已结束二个方法:以运行系统记事本为例方法一:这种方法会阻塞当前进程,直到运行的外部程序退出System.Diagnostics.Process exep = System.Diagnostics.Process.Start(@"C:WindowsNotepad.exe");exep.WaitForExit( 阅读全文

posted @ 2013-09-11 16:10 ArRan 阅读(362) 评论(0) 推荐(0) 编辑

摘要: 1. 我们有一个test.exe的WinForm程序,这是我们要加壳的目标程序。2. 新建一个WinForm工程,删除Form1,然后新建一个类。如下。3. 将test.exe 拷贝到该工程目录,作为嵌入式资源。using System;using System.Windows.Forms;using System.Resources;using System.Reflection;using System.IO;namespace test{ static class Program { [STAThread] static void Main(string[] args) { Stream 阅读全文

posted @ 2013-09-11 10:26 ArRan 阅读(570) 评论(0) 推荐(1) 编辑