第一个参数为数值
第二个参数为字符串新手
第二个参数为字符串新手
解决方案 »
- 怎么使用API关闭标题为“我的电脑”之类的文件夹窗口?
- 关于workflowProperties.Item["comment"]
- 【求教】线程 c# savedialog 使用问题
- datalist动态绑定图片的问题!~
- 我想在winform datagridview一个列中加入超链接,谁能帮我啊???
- xlFancyPlay媒体播放器,采用DirectX驱动,用C#编写(测试有分)
- 关于webform的小菜问题,希望大家指教,顶者有分
- 对象不能从 DBNull 转换为其他类型
- 关于dotmsn验证对方加入自己的问题
- 如何通过类型获取类名?
- 如何获取DataGridView中的有效行数?
- Math.Asin(25/35)为什么是0?
{
}
在 args 数组里面
static void Main(string[] args)
{
string arg = "";
int shu = 0;
for (int i=0; i < args.Length; i++)
{
switch (i)
{
case 0:
shu = Convert.ToInt32(args[i]);
break;
case 1:
arg = args[i];
break;
}
}
Console.WriteLine("{0}", shu);
Console.WriteLine("{0}", arg);
Console.ReadKey();
}感觉走了很多弯路,哪位高手能帮忙优化一下吗?
谢谢
static void Main(string[] args)
{
double d;
if (args.Length != 2 || !double.TryParse(args[0], out d))
{
Console.Write("Usage:");
Console.Write(System.Diagnostics.Process.GetCurrentProcess().ProcessName);
Console.WriteLine(" number string");
return;
}
string s = args[1];
//todo...
}