public static string getBaseDir ()
{
string baseDirLocal = System.Web.HttpContext.Current.Server.MapPath ( "~" );
Regex Remover = new Regex ( @"^.*(\\|\/)(.*)$" ,
RegexOptions.IgnoreCase | RegexOptions.Compiled );
string bareDir = Remover.Replace ( baseDirLocal , "$2" );
string strToRemoveAtEnd= System.Web.HttpContext.Current.Request.Url.AbsolutePath;
char [] charsToRemoveAtEnd = strToRemoveAtEnd.ToCharArray ();
string baseDir = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
baseDir = baseDir.TrimEnd ( charsToRemoveAtEnd );
baseDir = baseDir + "/" + bareDir + "/";
return baseDir;
} //eof method getBaseDir
Getting the Client IP Address in ASP.NET Core
-
[image: Client Ip Banner]
When I need to pick up the client IP Address in ASP.NET Core I always
forget where to find the connection information.
It's si...
1 week ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!