private NTCheckClass ntcheck = new NTCheckClass();
protected void Page_Load(object sender, EventArgs e)
{ GlobalDefinition.Cookie_LoginUser = "";
if (!Page.IsPostBack)
{
string username = Request.ServerVariables["LOGON_USER"];
int i=username.IndexOf("\\");
txtUserName.Text = username.Remove(0, i+1);
}
}还有下面的代码是什么意思,里面的数字代表什么??
DataColumn dc = new DataColumn();
dc.ColumnName = intdteTo.ToString().Substring(0, 4) + "/" + intdteTo.ToString().Substring(4, 2);
protected void Page_Load(object sender, EventArgs e)
{ GlobalDefinition.Cookie_LoginUser = "";
if (!Page.IsPostBack)
{
string username = Request.ServerVariables["LOGON_USER"];
int i=username.IndexOf("\\");
txtUserName.Text = username.Remove(0, i+1);
}
}还有下面的代码是什么意思,里面的数字代表什么??
DataColumn dc = new DataColumn();
dc.ColumnName = intdteTo.ToString().Substring(0, 4) + "/" + intdteTo.ToString().Substring(4, 2);
第一个数字是开始位置
第二个是截取几个字符
Substring(0, 4) //从第 0+1 位开始 取长度为4的字符串 结果"1234"
Substring(4, 2) //从第 4+1 位开始 取长度为2的字符串 结果"56"
从第 0 索引开始 取长度为4的字符串
http://msdn.microsoft.com/zh-cn/library/ms256054(VS.80).aspx
protected void Page_Load(object sender, EventArgs e)
{ GlobalDefinition.Cookie_LoginUser = "";
if (!Page.IsPostBack)
{
string username = Request.ServerVariables["LOGON_USER"];
int i=username.IndexOf("\\");
txtUserName.Text = username.Remove(0, i+1);
}
这是什么意思啊 ```!!