私は正常に動作する次のコードを持っていますが、サイトアドレスを変数に置き換える必要があります...
string url = HttpContext.Current.Request.Url.AbsoluteUri; // Get the URL
bool match = Regex.IsMatch(url, @"(^|\s)http://www.mywebsite.co.uk/index.aspx(\s|$)");
私は以下を試しましたが、うまくいきません、アイデアはありませんか?
string url = HttpContext.Current.Request.Url.AbsoluteUri; // Get the URL
string myurl = "http://www.mywebsite.co.uk/index.aspx";
bool match = Regex.IsMatch(url, @"(^|\s)"+myurl+"(\s|$)");