1) Http Posts (API)
2) C# Example
3) Visual Basic Example
1) Basic FTP Information
2) Advanced FTP (BLAST FILE FORMAT)
1) SMPP Information
1) Branding LogicSMS as your own
1) Send SMS using MS-SQL (Very Simple)
1) Posting back the message in real time
1) HTTP posts to dial a phone & play a message
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace LogicSMSCSharpExample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string HttpPost(string uri, string parameters)
{
// parameters: name1=value1&name2=value2
WebRequest webRequest = WebRequest.Create(uri);
//string ProxyString =
// System.Configuration.ConfigurationManager.AppSettings
// [GetConfigKey("proxy")];
//webRequest.Proxy = new WebProxy (ProxyString, true);
//Commenting out above required change to App.Config
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.Method = "POST";
byte[] bytes = Encoding.ASCII.GetBytes(parameters);
System.IO.Stream os = null;
try
{ // send the Post
webRequest.ContentLength = bytes.Length; //Count bytes to send
os = webRequest.GetRequestStream();
os.Write(bytes, 0, bytes.Length); //Send it
}
catch (WebException ex)
{
MessageBox.Show(ex.Message, "HttpPost: Request error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
if (os != null)
{
os.Close();
}
}
try
{ // get the response
WebResponse webResponse = webRequest.GetResponse();
if (webResponse == null)
{ return null; }
StreamReader sr = new StreamReader (webResponse.GetResponseStream());
return sr.ReadToEnd().Trim();
}
catch (WebException ex)
{
MessageBox.Show(ex.Message, "HttpPost: Response error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return null;
}
private void button1_Click(object sender, EventArgs e)
{
string sRes;
string sUrl;
string sParams;
string sState;
string sId;
System.Xml.XmlDocument oDoc = new System.Xml.XmlDocument();
sUrl="http://www.logicsms.co.za/postmsg2.aspx";
sParams = "username=uuu@org&password=*****&mobile=2782000000&message=Test&Originator=REPLY";
sRes=HttpPost(sUrl,sParams);
Console.WriteLine(sRes);
oDoc.LoadXml(sRes);
sState = oDoc.ChildNodes.Item (1).ChildNodes.Item(1).InnerXml;
sId = oDoc.ChildNodes.Item(1).ChildNodes.Item(0).InnerXml;
Console.WriteLine("SMS " + sState + " with reference number " + sId);
} // end HttpPost
}
}
|
|