Exemplo n.º 1
0
        public static string getUrlWithQuerystring(Dictionary <string, string> paramDic)
        {
            StringBuilder builder = new StringBuilder();
            int           i       = 0;

            foreach (string key in paramDic.Keys)
            {
                string value = paramDic[key];
                if (value == null)
                { // 过滤空的key
                    continue;
                }

                if (i != 0)
                {
                    builder.Append('&');
                }

                builder.Append(key);
                builder.Append('=');
                builder.Append(CenterServerManager.UrlEncode(value));

                i++;
            }

            return(builder.ToString());
        }
Exemplo n.º 2
0
 static int UrlEncode(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         string o    = CenterServerManager.UrlEncode(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }