我创建一个线程
Thread newThread= new Thread(DoSomeWork);
.
.
.
private void DoSomeWork()
{
}
Run Code Online (Sandbox Code Playgroud)
这与Worker线程有什么不同吗?如果它是..哪个更好,何时应该使用工作线程?我的应用程序需要有很多线程进行监控,刷新..
我有一个带有5个按钮的C#表单.用户输入信息,并且根据按下功能键,执行特定动作.F9-Execute Order F6,F3-Save ,-LookUp.
我添加了愚蠢的代码:
OnForm_Load
this.KeyUp += new System.Windows.Forms.KeyEventHandler(KeyEvent);
Run Code Online (Sandbox Code Playgroud)
和
private void KeyEvent(object sender, KeyEventArgs e) //Keyup Event
{
if (e.KeyCode == Keys.F9)
{
MessageBox.Show("Function F9");
}
if (e.KeyCode == Keys.F6)
{
MessageBox.Show("Function F6");
}
else
MessageBox.Show("No Function");
}
Run Code Online (Sandbox Code Playgroud)
但没有任何反应
谢谢
我有一组基于我分割字符串的值
string[] seperator = new string[9];
seperator[0] = "*"; //is the client
seperator[1] = "/"; //is the name of company
seperator[2] = "("; //name of the market
seperator[5] = ":"; //ID
seperator[6] = "?"; //orderType
seperator[3] = "!@"; //realtive Time
seperator[4] = "!+"; //
seperator[7] = "+"; //quantity
seperator[8] = "@";//price
string[] result = values.Split(seperator, StringSplitOptions.None);
Run Code Online (Sandbox Code Playgroud)
例如:输入字符串是*A/AB(M!@ 12:6?SIMPLE!+ 5 + 2
OUTPUT
[0]: ""
[1]: "A"
[2]: "AB"
[3]: "M"
[4]: "12"
[5]: "6"
[6]: "SIMPLE"
[7]: "5"
[8]: "2" …