RSS| 首页| 山顶道| 布珞阁¹| GoodUI| 土产| 关于

用C#使用jiwai API做免费短信通知
2008.04.10 9:40 bruce:

为了盯一个过期的cn域名,写了个自动程序每天早上4:00-4:30查过期域名状态,然后通过jiwai悄悄话发给自己,自己手机绑定了消息到手机,睡觉也能惊醒。

 结果tmd还是没抢赢那些职业的傻B“奥美新”、李九龙。那些简直不是人。即时昨晚起床了也不可能1分钟内搞定,后悔没看cnnic的到期列表,不然早上4:08分直接就1元钱点击了。哎,算了,不能便宜那帮孙子,不要也没什么损失。

贡献C#访问JIwai的代码:
        public void postjiwai(string msg)
        {
            try
            {
                 byte[] retBytes = null;
                 WebClient webClient = new WebClient();
                 webClient.Headers.Add(“Content-Type”, “application/x-www-form-urlencoded”);
                 NetworkCredential nc = new NetworkCredential(“your id”, “your password”);
                 webClient.Credentials = nc;
                 String status = HttpUtility.UrlEncode(“D bruce ” + msg);
                //D user message 悄悄话
                //@user message 发消息
                //message 自己留言
                 retBytes = webClient.UploadData(“http://api.jiwai.de/statuses/update.xml“, “POST”, System.Text.Encoding.Default.GetBytes(“status=” + status));
                 String retString = System.Text.Encoding.UTF8.GetString(retBytes);
                 Console.WriteLine(retString);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }

分类  日经| 3个评论


3个评论
  1. homo_sapiens 留言:

    您原来那个布珞阁2怎么变成机器人了?域名到期?也不来个公告啥的,好在有google不然找不到了。

  2. bruce 留言:

    朋友调了一下dns,可能设错了.

  3. 阿七 留言:

    请问你手机能收到普通消息么?我设置了似乎只能收到悄悄话,别的消息没动静。用QQ作为接收工具也一样。

垃圾太厉害了
说几句吧






*注意: 回复可能需要审查.您不必重复提交.