本文整理汇总了C#中HttpRequest.AddUrlParam方法的典型用法代码示例。如果您正苦于以下问题:C# HttpRequest.AddUrlParam方法的具体用法?C# HttpRequest.AddUrlParam怎么用?C# HttpRequest.AddUrlParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpRequest
的用法示例。
在下文中一共展示了HttpRequest.AddUrlParam方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: docs_save
public static dynamic docs_save(string path_file, string name_doc = "Unknown", string v = "5.21")
{
Dictionary<string, dynamic> result;
string error = "";
var request = new HttpRequest();
request.AddUrlParam("access_token", Settings1.Default.token);
request.AddUrlParam("v", v);
try
{
string content = request.Get(uri_api + "docs.getUploadServer").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
string url_upload = result["response"]["upload_url"];
request = new HttpRequest();
request.AddFile("file", path_file);
content = request.Post(url_upload).ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
request = new HttpRequest();
request.AddUrlParam("file", result["file"]);
request.AddUrlParam("title", name_doc.Replace(".jpg", ""));
request.AddUrlParam("access_token", Settings1.Default.token);
request.AddUrlParam("v", v);
content = request.Get(uri_api + "docs.save").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
string result_string = "doc" + result["response"][0]["owner_id"] + "_" + result["response"][0]["id"];
return result_string;
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}
示例2: friends_get
public static dynamic friends_get(string id_user, string fields = "screen_name, photo_max_orig")
{
Dictionary<string, dynamic> result;
string error;
var request = new HttpRequest();
request.AddUrlParam("user_ids", id_user);
request.AddUrlParam("order", "hints");
request.AddUrlParam("fields", fields);
request.AddUrlParam("access_token", Settings1.Default.token);
try
{
string content = request.Get(uri_api + "friends.get").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
return result["response"];
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}
示例3: getUploadServer
private static dynamic getUploadServer(string group_id = "", string v = "5.21")
{
Dictionary<string, dynamic> result;
string error = "";
var request = new HttpRequest();
request.AddUrlParam("group_id", group_id);
request.AddUrlParam("v", v);
request.AddUrlParam("access_token", Settings1.Default.token);
try
{
string content = request.Get(uri_api + "docs.getUploadServer").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
return result["response"]["upload_url"];
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}
示例4: message_send
public static dynamic message_send(string user_id, string message = "Привет от Шарпов", string attachment = "doc21881340_285976245")
{
Dictionary<string, dynamic> result;
string error = "";
var request = new HttpRequest();
request.AddUrlParam("user_id", user_id);
request.AddUrlParam("message", message);
request.AddUrlParam("attachment", attachment);
request.AddUrlParam("access_token", Settings1.Default.token);
try
{
string content = request.Get(uri_api + "messages.send").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
return result["response"];
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}
示例5: messages_history
public static dynamic messages_history(string id_user, string v="5.21")
{
Dictionary<string, dynamic> result;
string error = "";
var request = new HttpRequest();
request.AddUrlParam("user_id", id_user);
request.AddUrlParam("access_token", Settings1.Default.token);
request.AddUrlParam("v", v);
try
{
string content = request.Get(uri_api + "messages.getHistory").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
return result["response"];
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}
示例6: messages_get
public static dynamic messages_get(string count = "20")
{
Dictionary<string, dynamic> result;
string error = "";
var request = new HttpRequest();
request.AddUrlParam("out", "0");
request.AddUrlParam("access_token", Settings1.Default.token);
request.AddUrlParam("count", count);
request.AddUrlParam("time_offset", "0");
try
{
string content = request.Get(uri_api + "messages.get").ToString();
result = JsonConvert.DeserializeObject<Dictionary<string, dynamic>>(content);
return result["response"];
}
catch (Exception ex)
{
MessageBox.Show(error = ex.Message + " " + ex.InnerException);
return null;
}
}