C# Basics

一、变量命名规范:

//int整型,前面加i

int iAge=25;

//long整型,前面加l

long lSN=201010010001;

//double浮点型,前面加d            

double dWage=800.10;

//decimal浮点型,前面加m

decimal mTotal=10020.34;      

//bool逻辑型,前面加is

bool isLogin=false;      

//char字符型,前面加c

char cAnswer='y';                   

//string字符串型,前面加s

string sUserName="andy";      

//object对象型,前面加o

object oReturnValue=1;            

 

二、启动进程:

System.Diagnostics.Process process1 = new System.Diagnostics.Process();
process1.StartInfo.FileName = "calc.exe";
process1.Start();

System.Diagnostics.Process.Start("calc.exe");

 

三、启动线程:

Thread threadChatListen = new Thread(ChatListen);
threadChatListen.Start();

private void ChatListen()
{
    while (true)
    {
        TcpClient tcpClient = serverChatListener.AcceptTcpClient();
        if (tcpClient.Connected)
        {
            Thread threadChatClient = new Thread(ChatClientConnect);
            threadChatClient.Start(tcpClient);
        }
    }
}

private void ChatClientConnect(object sender)
{
    TcpClient tcpClient = sender as TcpClient;
    Application.Run(new FrmChat(tcpClient, this.Text, null, "ConnectOpen",null));
}

转载于:https://www.cnblogs.com/richandy/archive/2010/09/24/1833711.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值