转自:http://www.codeproject.com/Articles/26502/GetOpt-for-NET C#中的getopt封装,方便处理cmd命令。添加引用后,使用范例如下: using CodePoints; using System; ... public static void Main ( string [] args ) { int c = 0, aflag = 0, bflag = 0; string cvalue = "(null)"; while ( ( c = GetOpt.GetOptions(args, "abc:") ) != ( -1 ) ) { switch ( ( char ) c ) { case 'a': aflag = 1; break; case 'b': bflag = 1; break; case 'c': cvalue = GetOpt.Text; break; case '?': Console.WriteLine("Error in parsing option '{0}'", GetOpt.Item); break; default: return; } } Console.WriteLine("aflag = {0}, bflag = {1}, cvalue = {2}", aflag, bflag, cvalue); for ( int n = GetOpt.Index ; n < args.Length ; n++ )
- Hawend2014-09-15可以使用,但是7-zip解压不了,还得下载指定的快压解压软件
- 一剑平江湖2013-08-14代码还可以。
- 粉丝: 0
- 资源: 1
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助