Ejemplo n.º 1
0
        public string postData()
        {
            try
            {
                using (WebClient client = new WebClient())
                {
                    string postUrl = "http://anket.5adim.com/servis/Talepler.php/setTalepler";

                    byte[] gelenYanit = client.UploadValues(postUrl, new NameValueCollection()
                    {
                        { "token", "e37fd7e3df0fc392e925db0d7a901702" },
                        { "sirketId", db.degiskenler.SirketId },
                        { "adSoyad", AdSoyad },
                        { "denekNumara", GelisTipi + ProtokolId }
                    });

                    string        result = Encoding.UTF8.GetString(gelenYanit);
                    DonenDegerler obj    = JsonConvert.DeserializeObject <DonenDegerler>(result);

                    if (obj.sonuc == "success")
                    {
                        return(obj.data[0].ToString());
                    }
                    else
                    {
                        return("00");
                    }
                }
            }
            catch (Exception ex) { dosyaIslem(ex.ToString()); throw; }
        }
Ejemplo n.º 2
0
        public void smsGonder(string numara, string adSoyad)
        {
            try
            {
                string mesaj = db.degiskenler.SMSIcerik;
                mesaj = Regex.Replace(mesaj, "xxx", adSoyad, RegexOptions.IgnoreCase);
                string sonId = postData();
                string url   = "http://anket.5adim.com/?p=" + GelisTipi + ProtokolId + "." + sonId;
                mesaj += " " + url;

                using (WebClient client = new WebClient())
                {
                    string postUrl = "http://anket.5adim.com/servis/SMS.php/setSMS";

                    byte[] gelenYanit = client.UploadValues(postUrl, new NameValueCollection()
                    {
                        { "token", "e37fd7e3df0fc392e925db0d7a901702" },
                        { "SMSKullanici", db.degiskenler.SMSKullanici },
                        { "SMSKodu", db.degiskenler.SMSKodu },
                        { "SMSSifre", db.degiskenler.SMSSifre },
                        { "SMSBaslik", db.degiskenler.SMSBaslik },
                        { "mesaj", mesaj },
                        { "telefon", numara },
                        { "SMSSirket", db.degiskenler.SMSSirket }
                    });

                    string        result = Encoding.UTF8.GetString(gelenYanit);
                    DonenDegerler obj    = JsonConvert.DeserializeObject <DonenDegerler>(result);

                    if (obj.sonuc != "success")
                    {
                        dosyaIslem("Mesaj Gitmedi:" + mesaj);
                    }
                    else
                    {
                    }
                }
            }
            catch (Exception ex) { dosyaIslem(ex.ToString()); }
        }