zoukankan      html  css  js  c++  java
  • 使用短信通/微米发短信

    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.weimi.cc/

    string mobile = "<enter your mobiles>",
    cid = "<enter your cid>",
    uid = "<enter your UID>",
    pas = "<enter your UID Pass>",
    url = "http://api.weimi.cc/2/sms/send.html"; 
    byte[] byteArray = Encoding.UTF8.GetBytes("mob=" + mobile + "&cid=" + cid + "&uid=" + uid + "&pas=" + pas + "&type=json");
    HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(new Uri(url));
    webRequest.Method = "POST";
    webRequest.ContentType = "application/x-www-form-urlencoded";
    webRequest.ContentLength = byteArray.Length;
    Stream newStream = webRequest.GetRequestStream();
    newStream.Write(byteArray, 0, byteArray.Length);
    newStream.Close();
    HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
    StreamReader php = new StreamReader(response.GetResponseStream(), Encoding.Default);
    string Message = php.ReadToEnd();
    System.Console.Write(Message);
    System.Console.Read();
  • 相关阅读:
    c++看题
    理想化
    thin mission
    编程时 和 thinking
    tiny mission 2021 10 20
    A Magic Lamp HDU
    Poj 3370
    鸽巢原理(抽屉原理)
    Miller-Rabin质数测试
    Nim or not Nim? HDU
  • 原文地址:https://www.cnblogs.com/tgdjw/p/5335842.html
Copyright © 2011-2022 走看看