Exemple #1
0
 /// <summary>
 /// Http发送请求 字符串参数 返回泛型
 /// </summary>
 /// <param name="httpUri">请求地址</param>
 /// <param name="method">请求的方法</param>
 /// <param name="httpData">请求参数 例:{"value": "http"} C#格式(@"{""value"":""http""}")</param>
 /// <returns></returns>
 public static T HttpSend <T>(string httpUri, string method, string httpData)
 {
     if (typeof(T) == typeof(string))
     {
         return((T)(object)HttpSend(httpUri, method, httpData));
     }
     return(CoreConvert.JsonToObj <T>(HttpSend(httpUri, method, httpData)));
 }
Exemple #2
0
 /// <summary>
 /// 读取配置
 /// </summary>
 /// <typeparam name="T">读取的类型</typeparam>
 /// <param name="key">配置键</param>
 /// <param name="configPath">配置文件路径</param>
 /// <param name="endpoint">终结点(默认root)</param>
 /// <returns>配置值</returns>
 public static T Rini <T>(string key, string configPath, string endpoint)
 {
     return(CoreConvert.JsonToObj <T>(Rini(key, configPath, endpoint)));
 }
Exemple #3
0
 /// <summary>
 /// 读取配置
 /// </summary>
 /// <param name="key">配置键</param>
 /// <param name="path">配置文件路径</param>
 /// <returns>配置值</returns>
 public static T ReadCfg <T>(string key, string path)
 {
     return(CoreConvert.JsonToObj <T>(ReadCfg(key, path)));
 }