Esempio n. 1
0
        /// <summary>
        /// 获取QueryString中的数据
        /// </summary>
        public static bool ValidUrlGetData()
        {
            bool result = false;

            for (int i = 0; i < HttpContext.Current.Request.QueryString.Count; i++)
            {
                result = HasInjectionData(HttpContext.Current.Request.QueryString[i].ToString());
                if (result)
                {
                    LogTextHelper.Info("检测出GET恶意数据: 【" + HttpContext.Current.Request.QueryString[i].ToString() + "】 URL: 【" + HttpContext.Current.Request.RawUrl + "】来源: 【" + HttpContext.Current.Request.UserHostAddress + "】");
                    break;
                }
            }
            return(result);
        }
        private static void InternalRegisterFileAssociations(
            bool unregister, string progId, bool registerInHKCU,
            string appId, string openWith, string[] extensions)
        {
            string Arguments = string.Format("{0} {1} {2} \"{3}\" {4} {5}",
                                             progId,         // 0
                                             registerInHKCU, // 1
                                             appId,          // 2
                                             openWith,
                                             unregister,
                                             string.Join(" ", extensions));

            try
            {
                Process(Arguments.Split(' '));
            }
            catch (Win32Exception e)
            {
                if (e.NativeErrorCode == 1223) // 1223: The operation was canceled by the user.
                {
                    LogTextHelper.Info("该操作已经被用户取消。");
                }
            }
        }