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();
  • 相关阅读:
    HTML_<select>
    HTML_<a>
    MySQL_知识点
    MySQL_常用SQL语句
    GIT
    MyBatis_传入参数的问题
    js函数防抖与节流总结
    node 常用方法 生成密钥 token验证 验证码生成 (持续更新)
    node 登陆拦截中间件(egg)
    js 给页面容器增加水印
  • 原文地址:https://www.cnblogs.com/tgdjw/p/5335842.html
Copyright © 2011-2022 走看看