using System
using System
using System
using System
using System
using System
using System
using System
using System
using System
using System
using cn
///
/// Mobmsg 的摘要說明
///
public class Mobmsg
{
private string _MobNum;
private string _MobMsg;
public Mobmsg()
{
//
// TODO: 在此處添加構造函數邏輯
//
}
public Mobmsg(string MobNum
{
this
this
}
public void SendMsg()
{
if (CheckType(this
ToMobile()
else
ToUnicom()
}
public void ToMobile()
{//移動的接口
Encoding encoding = Encoding
string enterpriseid =
string accountid =
string pwd =
string postData =
string strUrl =
byte[] data = encoding
// 准備請求…
HttpWebRequest myRequest = (HttpWebRequest)WebRequest
myRequest
myRequest
myRequest
Stream newStream = myRequest
// 發送數據
newStream
newStream
}
public void ToUnicom()
{//聯通的接口
cn
string MySessionID =
myLogin
myLogin
myLogin
LoginMes mes
mes
SmWSImplService Binding = new SmWSImplService()
OpResult Value
try
{
Value
}
catch
{
;
}
MySessionID = Value
SendBatchSMS(Binding
Value
}
public bool CheckType(string MobileNum)
{
string ForeStr = MobileNum
int ForeNum = Convert
if (ForeNum <=
return false;
else
return true;
}
public void SendBatchSMS(SmWSImplService Binding
{
BatchMsg MySendSM = new BatchMsg()
OpResult Value
string[] SendAddrs = new string[
SendAddrs[
MySendSM
MySendSM
MySendSM
Value
MySendSM=null;
Value
}
}
在調用聯通的接口的時候還要添加一個 webservice
然後我們可以在其它頁面使用
Mobmsg msg = new Mobmsg(
msg
這樣就可以了
From:http://tw.wingwit.com/Article/program/net/201311/12928.html