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();
  • 相关阅读:
    lua协程一则报错解决“attempt to yield across metamethod/C-call boundary”
    web server && web framework角色区分
    throttle在程序中的作用
    如何将SVN patch的修改做成old&new文件
    lua 环境揭秘
    lua module package.seeall选项
    lua module环境探秘
    lua OOP实现对象的链式调用
    项目管理(一)任务分配
    项目管理(三)展望
  • 原文地址:https://www.cnblogs.com/tgdjw/p/5335842.html
Copyright © 2011-2022 走看看