コード例 #1
0
 public string UploadFile(string modulename, string methodname, string localfile)
 {
     try
     {
         if (G.CurrentSession == null)
         {
             G.CurrentSession = new UserSessionEntity();
         }
         Dictionary <string, string> dic = new Dictionary <string, string>();
         string url  = APIUrlBuilder.CreateUrl(modulename, methodname, G.CurrentSession.SessionID, string.Empty, out dic);
         string json = h.Upload(url, localfile, dic); //h.Post(url, "data=" + System.Web.HttpUtility.UrlEncode(data, Encoding.UTF8), "", Encoding.UTF8, dic);
         return(json);
     }
     catch (Exception ex)
     {
         LogUtil.WriteLog(ex);
         return(JsonObj <JsonMessageBase> .ToJson(new JsonMessageBase()
         {
             Status = 0, Msg = ex.Message
         }));
     }
 }