1优化拍单逻辑 2优化部分文件位置命名等

This commit is contained in:
wule committed 2026-06-25 16:45:28 +08:00
1 parent 34c51c6fcd
commit 1e27c0b1e1
65 files changed
+2594 -268

No files matched your search

+61
View File
@@ -665,5 +665,66 @@ namespace AllBase
Match m = reg.Match(url);
return m.Groups["VAL"].ToString(); ;
}
/// <summary>
/// 获取值
/// </summary>
/// <param name="html"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetStringQuery(ref string queryString, string key)
{
//var queryStringTmp = "&" + queryString;
//int nIndex = queryStringTmp.IndexOf(key + "=");
//if (nIndex == -1)
// return null;
//string temp = queryStringTmp.Substring(nIndex).Replace(key + "=", "");
//nIndex = temp.IndexOf('&');
//if (nIndex > -1)
// temp = temp.Substring(0, nIndex);
//return temp;
try { return GetURLParams(queryString, key); } catch { return null; }
}
/// <summary>
/// 获取值
/// </summary>
/// <param name="html"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetStringCookie(ref string cookieStr, string key)
{
int nIndex = cookieStr.IndexOf(key + "=");
if (nIndex == -1)
return null;
string temp = cookieStr.Substring(nIndex).Replace(key + "=", "");
nIndex = temp.IndexOf(';');
if (nIndex > -1)
temp = temp.Substring(0, nIndex);
return temp;
}
public static string FliterHtmlTag(string htmlStr)
{
if (String.IsNullOrEmpty(htmlStr))
{
return "";
}
string regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>"; //定义style的正则表达式
string regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>"; //定义script的正则表达式
string regEx_html = "<[^>]+>"; //定义HTML标签的正则表达式
htmlStr = Regex.Replace(htmlStr, regEx_style, "");//删除css
htmlStr = Regex.Replace(htmlStr, regEx_script, "");//删除js
htmlStr = Regex.Replace(htmlStr, regEx_html, "");//删除html标记
htmlStr = Regex.Replace(htmlStr, "\\s*|\t|\r|\n", "");//去除tab、空格、空行
htmlStr = htmlStr.Replace("\"", "");//去除异常的引号
return htmlStr.Trim();
}
}
}