Пример #1
0
 private static void RecordLog(Exception ex)
 {
     new TxtLog(ServerHelper.MapPath(@"\Log\")).Write(ex.ToString());
 }
Пример #2
0
        /// <summary>
        /// 获取Get请求地址,去除参数
        /// </summary>
        /// <param name="key">要去除的参数</param>
        /// <returns>参数连接字符串</returns>
        public static string FilterRequestQueryString(string[] keyArray)
        {
            string requestQueryString = string.Empty;
            SortedDictionary <string, string> requestArray = GetRequestQueryString();

            foreach (string key in keyArray)
            {
                if (requestArray.ContainsKey(key))
                {
                    requestArray.Remove(key);
                }
            }
            foreach (KeyValuePair <string, string> item in requestArray)
            {
                if (!string.IsNullOrEmpty(item.Value))
                {
                    requestQueryString = string.Concat(requestQueryString, "&", item.Key, "=", ServerHelper.UrlEncode(item.Value));
                }
            }
            if (requestQueryString.StartsWith("&"))
            {
                requestQueryString = requestQueryString.Substring(1);
            }
            return(requestQueryString);
        }