Esempio n. 1
0
        public static string SendMMSToWG(string id, string pwd, string Mobile, string Subject, string Content)
        {
            string result   = "";
            string subject  = HexConvert.StringToHexString(Subject, SendMessage.encode);
            string d        = Convert.ToString(1);
            string tt       = "txt";
            string file     = HttpContext.Current.Server.MapPath("");
            string tv       = HexConvert.GetHexString(HexConvert.FileToBytes(file + "\\Readme.txt"));
            string pt       = "jpg";
            string pv       = HexConvert.GetHexString(QRCodeImage.imageToByte(Content));
            string url      = "http://118.144.76.79:8080/mmsServer/sendMms";
            string postdata = string.Concat(new string[]
            {
                "id=",
                id,
                "&pwd=",
                pwd,
                "&subject=",
                subject,
                "&d1=",
                d,
                "&tt1=",
                tt,
                "&tv1=",
                tv,
                "&pt1=",
                pt,
                "&pv1=",
                pv,
                "&mt1=&mv1="
            });
            string mms_id = SendMessage.PostSend(url, postdata);

            if (mms_id != null & int.Parse(mms_id) > 0)
            {
                url      = "http://118.144.76.79:8080/mmsServer/sendMobile";
                postdata = string.Concat(new string[]
                {
                    "id=",
                    id,
                    "&pwd=",
                    pwd,
                    "&yw=10690029yd&mobile=",
                    Mobile,
                    "&mms_id=",
                    mms_id
                });
                result = SendMessage.PostSend(url, postdata);
            }
            return(result);
        }