http://www.duanxin.cm/
class Program { static string url = "http://180.97.163.89:8012/OpenPlatform/OpenApi"; static void Main(string[] args) { var t = Task.Run(() => PostMessage()); t.Wait(); } public static async Task PostMessage() { var pairs = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>( "action", "sendOnce" ), new KeyValuePair<string, string>( "ac", "1001@" ), new KeyValuePair<string, string>( "authkey", "D5528AA2EEED774746754FF9CE36DA8D" ), new KeyValuePair<string, string>( "cgid", "6" ), new KeyValuePair<string, string> ( "c", "感谢您使用 爱考位 订单代报,您的订单号是:034421" ), new KeyValuePair<string, string> ( "m", "13429329134" ) }; var content = new FormUrlEncodedContent(pairs); using (var client = new HttpClient()) { var response = await client.PostAsync(url, content); string jsonMessage = await response.Content.ReadAsStringAsync(); } } }
原文:http://www.cnblogs.com/tgdjw/p/5335842.html