If it's a string, you could try doing a search for the "/" character and getting the character position ( mystring.IndexOf("/") ) and then doing a substring of it.
So for example:
-
string mys="mydomain/plater";
-
int n=mys.IndexOf("/");
-
if (n!=-1)//if "/" is not in the string a -1 is returned
-
{
-
mys=mys.Substring(n+1);//also want to remove the "/" character
-
}
-
//now the varriable mys should contain "plater"
-
This looks interesting..Is it possible you could show me how this would be coded on a page to use this with the AUTH_USER server variable and session state? Thanks!
Here's my code that I'm experimenting with:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%Session["User"] = Request.ServerVariables["AUTH_USER"]; %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body>
<p><%=Session["User"]%></p>
</body>
</html>