作者gz (..)
看板C_Sharp
标题Re: [问题] 输入参数
时间Mon May 1 21:15:08 2006
※ 引述《HsiaoM (A Better Man)》之铭言:
: 在Console Application时
: 可以用argv, argc来引入外部参数
: 在Form的程式里面
: 要怎麽样引入这样的外部参数呢?
// 简单范例
public class Form1 : System.Windows.Forms.Form
{
private string MyString;
public Form1()
{
}
public Form1(string str)
{
MyString = str;
}
}
public class MyClass
{
public static void Main(string[] args)
{
if (args.Length != 0)
Application.Run(new Form1(args[0]));
else
Application.Run(new Form1());
}
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 210.58.72.70
1F:→ HsiaoM:谢谢 我知道了 ^^ 05/01 23:31