返回类型是枚举

 public Enum ReturnCode
        {
             public ErrorCode errorCode{get;set;}
             public string errorMsg{get;set;}
        }
        public enum ErrorCode
        {
              请求成功 = 0,
              不合法的文件类型 = 40005,
       
              不合法的文件大小 = 40006
     }  
        
        ReturnCode returnCode=js.Deserialize(returnText);
        if(returnCode.errorCode!=Errorcode.请求成功)
        {
              //发生错误
        }


            WxJsonResult errorResult = js.Deserialize(returnText);


public T Deserialize(
    string input
)

Parameters

input
    Type: System.String

    The JSON string to be deserialized.

Return Value
Type: T

The deserialized object.
Type Parameters

T

    The type of the resulting object.
              

CookieContainer cookieContainer=null;
System.Net.CookieContainer   用来存cookie的   response.Cookies=cookieContainer.GetCookies(response.ResponseUri);

你可能感兴趣的:(C#)