如何给Main方法传参数
2015-09-21 11:04
302 查看
今天项目里需要调用一个控制台应用程序,并且给Main方法传参数,可参考如下做法:
using System; namespace ConsoleArgs { class Program { static void Main(string[] args) { Console.WriteLine(args[0] == "Admin" &&args[1] == "root" ? "Hello Admin" : "Please input correct name."); } } }执行效果:
相关文章推荐
- EAintroPage的使用
- rails 时间格式化
- 人类是否能够接受人工智能(AI)的存在?
- does not contain bitcode
- Xcode 添加 SVN 出现 nsurlerrordomain error 1012
- mail 发邮件
- 地址待验证----原创 【系统篇】PC 黑苹果破解版OS X Mountain Lion 10.8.X 系统大集合
- Sendmail+dovecot+saslauth+rainloop
- LeetCode Container With Most Water
- AIX nohup 不输出日志
- Failed to install xxxx.apk on device 'emulator-5554!
- 管道的应用(pipe)《深入分析Linux内核源码》 http://blog.csdn.net/wangpengqi/article/details/7996182
- hdu 1302 The Snail
- [LeetCode] Contains Duplicate
- tail -f log.txt命令的小技巧------观察日志log.txt的动态变化
- leetcode 217:Contains Duplicate
- 文字与图像的绘制
- ARC与非ARC的循环引用
- 关于AIDL进程间通信
- Codeforces 475C Kamal-ol-molk's Painting 模拟