小编Tj.*_*Tj.的帖子

什么是工作线程及其与我创建的线程的区别?

我创建一个线程

Thread newThread= new Thread(DoSomeWork);

.
.
.
private void DoSomeWork()
{
}
Run Code Online (Sandbox Code Playgroud)

这与Worker线程有什么不同吗?如果它是..哪个更好,何时应该使用工作线程?我的应用程序需要有很多线程进行监控,刷新..

c# multithreading

26
推荐指数
3
解决办法
3万
查看次数

处理功能按键

我有一个带有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)

但没有任何反应

谢谢

c#

18
推荐指数
1
解决办法
5万
查看次数

C# - 拆分字符串的问题

我有一组基于我分割字符串的值

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" …

c# string split

1
推荐指数
1
解决办法
420
查看次数

标签 统计

c# ×3

multithreading ×1

split ×1

string ×1