- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
public class VKUrlManager
{
public static string API_URL = "http://api.vkontakte.ru/api.php";
public static string WithdrawVotes(int iVotes, int iUserID)
{
string sTime = "timestamp=" + DateTime.Now.ToFileTimeUtc();
string sRandom = "random=" + GE.Utils.GetRandom(int.MaxValue);
return API_URL + "?api_id=" + DA.AppConfig.ApiId
+ "&method=secure.withdrawVotes"
+ "&v=2.0"
+ "&" + sRandom
+ "&" + sTime
+ "&uid=" + iUserID
+ "&votes=" + iVotes
+ "&sig=" + GenerateSig(new string[]
{ "api_id=" + DA.AppConfig.ApiId, "v=2.0", "method=secure.withdrawVotes",
"uid=" + iUserID, "votes=" + iVotes,
sTime,sRandom
});
}
public static string GenerateSig(string[] aParams)
{
Array.Sort(aParams);
string s = "";
for(var i = 0; i< aParams.Length; i++)
s += aParams[i];
s += DA.AppConfig.ApiSecret;
return GE.Utils.GetMD5Hash(s);
}
}