获取网站的根目录.doc获取网站的根目录.doc
#region 是否存在指定的字符串
///
/// 是否存在指定的字符串
///
/// 比较的字符串
/// 要比较的模式
///
public bool IsExistsStr(string oriStr, string compareStr)
{
return Regex.IsMatch(oriStr, string.Format(compareStr));
}
#endregion
#region 是否存在指定的字符串 判断要比较的字符串是否在oriStr中 ...
获取网站的根目录.doc
#region 是否存在指定的字符串
///
/// 是否存在指定的字符串
///
///
比较的字符串
///
要比较的模式
///
public bool IsExistsStr(string oriStr, string compareStr)
{
return Regex.IsMatch(oriStr, string.Format(compareStr));
}
#endregion
#region 是否存在指定的字符串 判断要比较的字符串是否在oriStr中
///
/// 是否存在指定的字符串 判断要比较的字符串是否在oriStr中
///
///
比较的字符串
///
要比较的字符串
///
这个只不过是为了方法重构
///
public bool IsExistsStr(string oriStr, string compareStr, bool con)
{
//^[A-Za-z]+[A-Za-z0-9]*_*$
return Regex.IsMatch(oriStr, "^([\u4e00-\u9fa5]|[A-Za-z]|[0-9]|[\x00-\xff]|\\.)*" +
compareStr + "([\u4e00-\u9fa5]|[A-Za-z]|[0-9]|[\x00-\xff]|\\.)*$", RegexOptions.IgnoreCase);
}
#endregion
#region 获取网站的根目录
///
/// 获取网站的根目录
///
///
public string GetRootURI()
{
string AppPath = "";
HttpContext HttpCurrent = HttpContext.Current;
HttpRequest Req;
if (HttpCurrent != null)
{
Req = HttpCurrent.Request;
string UrlAuthority = Req.Url.GetLeftPart(UriPartial.Authority);
if (Req.ApplicationPath == null || Req.ApplicationPath == "/")
{
//直接安装在 Web 站点
AppPath = UrlAuthority;
}
else
{
//安装在虚拟子目录下
AppPath = UrlAuthority + Req.ApplicationPath;
}
}
return AppPath;
}
#endregion
本文档为【获取网站的根目录.doc】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。