-4
如何获取当前在桌面上进行更改的用户名?一个按钮?如何获取当前用户名 - 在ASP.NET中使用我的代码
private string GetCurrentUserName()
{
return Utilities.CurrentUsername();
}
公用设施:
public static string CurrentUsername()
{
string[] data = HttpContext.Current.User.Identity.Name.ToString().Split(new char[] { '\\' });
string retVal = data[1];
return retVal;
}
这甚至意味着什么?您需要澄清更多 – 2009-08-06 17:05:49
FWIW,您可以使用'.Split('\\');'('Split'采用'params char []') – 2009-08-06 17:07:42
我有一个代码: public static string CurrentUsername() string [] data = HttpContext.Current.User.Identity.Name.ToString()。Split(new char [] {'\\'}); string retVal = data [1]; return retVal; } 我如何在.net上使用这个名称来获取当前用户名,以便在表上进行更改的人员?我应该从.net使用什么工具? – Yves 2009-08-06 17:07:43