watch the designing part in video:
Code:
Import following library file:
using System;
using System.Collections.Generic;
using System.Net;
using System.Collections.Specialized;
using System.IO;
Code:
String result;
string apiKey = txtapi.Text;
string numbers = txtnum.Text; // in a comma seperated list
string message = txtmess.Text;
string send = txtseder.Text;
String url = "https://api.txtlocal.com/send/?apikey=" + apiKey + "&numbers=" + numbers + "&message=" + message + "&sender=" + send;
//refer to parameters to complete correct url string
StreamWriter myWriter = null;
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "POST";
objRequest.ContentLength = Encoding.UTF8.GetByteCount(url);
objRequest.ContentType = "application/x-www-form-urlencoded";
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(url);
}
catch (Exception ex)
{
//return e.Message;
MessageBox.Show(null, "the error is" + ex, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
myWriter.Close();
}
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
//return result;
MessageBox.Show(result);
}
Import following library file:
using System;
using System.Collections.Generic;
using System.Net;
using System.Collections.Specialized;
using System.IO;
do you have for the visual basic 2013
ReplyDelete