Example #1
0
 private void loginBtn_Click(object sender, EventArgs e)
 {
     if (usernameTxt.Text.Equals("admin") && passwordTxt.Text.Equals("momfo"))
     {
         if (clnameTxt.Text.Equals("") || clpwdTxt.Text.Equals(""))
         {
             MessageBox.Show("请输入创蓝短信群发用户名或密码!","登录失败");
             log.write("login failure, wrong chuanglan name or passsowrd " + log.getIP());
         }
         else
         {
             log.write("login success,"+ log.getIP());
             SmsInfo s = new SmsInfo();
             s.set(clnameTxt.Text, clpwdTxt.Text);
             Send send = new Send();
             send.set(s);
             this.Hide();
             send.Show();
         }
     }
     else
     {
         MessageBox.Show("用户名或密码错误!", "登录失败");
         count++;
         if (count >= 3)
         {
             MessageBox.Show("错误次数过多,将自动关闭客户端", "登录失败");
             log.write("try too much wrong exit," + log.getIP());
             System.Environment.Exit(0);
         }
     }
 }
Example #2
0
 public static String send(SmsInfo s, String mobile, String content)
 {
     try
     {
         //String url = s.url+"?account=" + s.account + "&pswd=" + s.pswd + "&mobile=" + mobile + "&msg=" + System.Web.HttpUtility.UrlEncode(content) + "&needstatus=" + s.needstatus;
         String         newContent = SmsSend.toUrlString(content);
         String         url        = s.url + "?account=" + s.account + "&pswd=" + s.pswd + "&mobile=" + mobile + "&msg=" + newContent + "&needstatus=" + s.needstatus;
         Uri            uri        = new Uri(url);
         HttpWebRequest request    = (HttpWebRequest)WebRequest.Create(uri);
         request.Method      = "GET";
         request.ContentType = "text/html;charset=UTF-8";
         HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
         Stream          myResponseStream = response.GetResponseStream();
         StreamReader    myStreamReader   = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
         string          retString        = myStreamReader.ReadToEnd();
         myStreamReader.Close();
         myResponseStream.Close();
         log.write(mobile + "--" + content.Trim());
         log.write(retString);
         return(retString.Split(',')[1]);
     }
     catch
     {
         return("wrong");
     }
 }
Example #3
0
 public static String send(SmsInfo s, String mobile, String content)
 {
     try
     {
         //String url = s.url+"?account=" + s.account + "&pswd=" + s.pswd + "&mobile=" + mobile + "&msg=" + System.Web.HttpUtility.UrlEncode(content) + "&needstatus=" + s.needstatus;
         String newContent = SmsSend.toUrlString(content);
         String url = s.url + "?account=" + s.account + "&pswd=" + s.pswd + "&mobile=" + mobile + "&msg=" + newContent + "&needstatus=" + s.needstatus;
         Uri uri = new Uri(url);
         HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
         request.Method = "GET";
         request.ContentType = "text/html;charset=UTF-8";
         HttpWebResponse response = (HttpWebResponse)request.GetResponse();
         Stream myResponseStream = response.GetResponseStream();
         StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
         string retString = myStreamReader.ReadToEnd();
         myStreamReader.Close();
         myResponseStream.Close();
         log.write(mobile + "--" + content.Trim());
         log.write(retString);
         return retString.Split(',')[1];
     }
     catch
     {
         return "wrong";
     }
 }
Example #4
0
 private void loginBtn_Click(object sender, EventArgs e)
 {
     if (usernameTxt.Text.Equals("admin") && passwordTxt.Text.Equals("momfo"))
     {
         if (clnameTxt.Text.Equals("") || clpwdTxt.Text.Equals(""))
         {
             MessageBox.Show("请输入创蓝短信群发用户名或密码!", "登录失败");
             log.write("login failure, wrong chuanglan name or passsowrd " + log.getIP());
         }
         else
         {
             log.write("login success," + log.getIP());
             SmsInfo s = new SmsInfo();
             s.set(clnameTxt.Text, clpwdTxt.Text);
             Send send = new Send();
             send.set(s);
             this.Hide();
             send.Show();
         }
     }
     else
     {
         MessageBox.Show("用户名或密码错误!", "登录失败");
         count++;
         if (count >= 3)
         {
             MessageBox.Show("错误次数过多,将自动关闭客户端", "登录失败");
             log.write("try too much wrong exit," + log.getIP());
             System.Environment.Exit(0);
         }
     }
 }
Example #5
0
 public void set(SmsInfo s)
 {
     this.smsInfo=s;
 }
Example #6
0
 public void set(SmsInfo s)
 {
     this.smsInfo = s;
 }