?? jl.cs
字號(hào):
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace apolloService
{
/// <summary>
/// JL 的摘要說明。
/// </summary>
public class JL
{
#region Dll Import
[DllImport("JL_ISP.dll",EntryPoint="JL_HTTPLogin")]
static extern int JL_HTTPLogin (
string strHost,
int nPort,
string strUserId,
string strPassword,
string strRegCode,
ref IntPtr pHandle);
[DllImport("JL_ISP.dll",EntryPoint="JL_SendMsg")]
static extern int JL_SendMsg ( IntPtr pHandle, //操作句柄
string strFromPhone, // strFromPhone 短消息發(fā)送者手機(jī)號(hào)碼 ,可以發(fā)送單條或者多條短信,多個(gè)號(hào)碼之間用 "," 隔開
string strToPhone, // strToPhone 目的手機(jī)號(hào)碼
string strContent, // strContent 信息內(nèi)容
string strSendTime);
[DllImport("JL_ISP.dll",EntryPoint="JL_Logout")]
static extern int JL_Logout (IntPtr pHandle);
[DllImport("JL_ISP.dll",EntryPoint="JL_ReceiveSM")]
static extern int JL_ReceiveSM (IntPtr pHandle, int nLastMsgId);
[DllImport("JL_ISP.dll",EntryPoint="JL_GetOneSM")]
static extern int JL_GetOneSM (IntPtr pHandle,
ref int pnMsgID,
StringBuilder strFrom,
StringBuilder strCreateTime,
StringBuilder strContent);
//--------------------------------------------------------------------------
[DllImport("JL_ISP.dll",EntryPoint="JL_GetAccountBalance")]
static extern int JL_GetAccountBalance (IntPtr pHandle, ref Single fBalance);
[DllImport("JL_ISP.dll",EntryPoint="JL_GetAccountPrice")]
static extern int JL_GetAccountPrice (IntPtr pHandle, ref Single fPrice);
[DllImport("JL_ISP.dll",EntryPoint="JL_GetAccountType")]
static extern int JL_GetAccountType (IntPtr pHandle, ref int nType);
[DllImport("JL_ISP.dll",EntryPoint="JL_GetAccountRegTime")]
static extern int JL_GetAccountRegTime (IntPtr pHandle, StringBuilder strDate);
[DllImport("JL_ISP.dll",EntryPoint="JL_GetAccountDenyTime")]
static extern int JL_GetAccountDenyTime (IntPtr pHandle,StringBuilder strDate);
//--------------------------------------------------------------------------
[DllImport("JL_ISP.dll",EntryPoint="JL_GetSendCount")]
static extern int JL_GetSendCount (IntPtr pHandle,
string strStartDate,
string strEndDate,
ref int nCountWaitSend,
ref int nCountTestSend);
[DllImport("JL_ISP.dll",EntryPoint="JL_ModifyPassword")]
static extern int JL_ModifyPassword (IntPtr pHandle,string strNewPassword);
//--------------------------------------------------------------------------
[DllImport("User32.dll",EntryPoint="FindWindow")]
private static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("user32.dll",EntryPoint="FindWindowEx")]
private static extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[DllImport("User32.dll",EntryPoint="SendMessage")]
private static extern int SendMessage(IntPtr hWnd,
int Msg, IntPtr wParam, string lParam);
#endregion
public JL()
{
//
// TODO: 在此處添加構(gòu)造函數(shù)邏輯
//
}
public int HTTPLogin(string strHost,int nPort,string strUserId,string strPassword,string strRegCode,ref IntPtr pHandle)
{
int bRtn = JL_HTTPLogin(strHost,nPort,strUserId,strPassword,strRegCode,ref pHandle);
return bRtn;
}
public int Logout(IntPtr pHandle)
{
JL_Logout(pHandle);
return 0;
}
public int ReceiveSM (IntPtr pHandle, int nLastMsgId)
{
int bRtn = JL_ReceiveSM(pHandle,nLastMsgId);
return bRtn;
}
//
public int GetAccountBalance (IntPtr pHandle, ref Single fBalance)
{
int bRtn = JL_GetAccountBalance(pHandle,ref fBalance);
return bRtn;
}
public int GetAccountPrice (IntPtr pHandle, ref Single fPrice)
{
int bRtn = JL_GetAccountPrice(pHandle,ref fPrice);
return bRtn;
}
public int GetAccountType (IntPtr pHandle, ref int nType)
{
int bRtn = JL_GetAccountType(pHandle,ref nType);
return bRtn;
}
public int GetAccountRegTime (IntPtr pHandle,StringBuilder strDate)
{
int bRtn = JL_GetAccountRegTime(pHandle,strDate);
return bRtn;
}
public int GetAccountDenyTime (IntPtr pHandle,StringBuilder strDate)
{
int bRtn = JL_GetAccountDenyTime(pHandle,strDate);
return bRtn;
}
//---------------------------------------------------------------------------------------------
public int SendMsg(IntPtr pHandle, string fPhone, string tphone, string content, string stime)
{
int bRtn = JL_SendMsg(pHandle,fPhone,tphone,content,stime);
return bRtn;
}
//---------------------------------------------------------------------------------------------
public int GetSendCount(IntPtr pHandle, string strStartDate, string strEndDate,ref int nCountWaitSend,ref int nCountTestSend)
{
int bRtn = JL_GetSendCount(pHandle, strStartDate, strEndDate,ref nCountWaitSend,ref nCountTestSend);
return bRtn;
}
public int ModifyPassword (IntPtr pHandle,string strNewPassword)
{
int bRtn = JL_ModifyPassword (pHandle,strNewPassword);
return bRtn;
}
public int GetOneSM(IntPtr pHandle, ref int pnMsgID,StringBuilder strFrom,StringBuilder strCreateTime,StringBuilder strContent)
{
int bRtn = JL_GetOneSM(pHandle, ref pnMsgID,strFrom,strCreateTime,strContent);
return bRtn;
}
public string Message(int bRtn)
{
switch (bRtn)
{
case 0:
return "正常.";
case 1:
return "TCP方式登錄. ";
case 2:
return "HTTP方式登錄. ";
case -1:
return "EPID錯(cuò)誤. ";
case -2:
return "無該用戶. ";
case -3:
return "注冊(cè)碼錯(cuò) ";
case -4:
return "用戶被停用. ";
case -5:
return "未注冊(cè)成功.";
case -6:
return "超出使用日期";
case -7:
return "費(fèi)用不足";
case -8:
return "源手機(jī)錯(cuò)誤. ";
case -9:
return "目的手機(jī)錯(cuò)誤. ";
case -10:
return "信息內(nèi)容錯(cuò)誤. ";
case -11:
return "連接失敗. ";
case -12:
return "系統(tǒng)內(nèi)部錯(cuò)誤或者無效的客戶狀態(tài).";
case -13:
return "客戶權(quán)限不對(duì)";
case -14:
return "不是從指定的IP處登錄";
case -15:
return "帳號(hào)已經(jīng)登錄(TCP). ";
case -16:
return "內(nèi)部通訊錯(cuò)誤. ";
case -17:
return "無可用的MT通道. ";
case -18:
return "不支持該功能";
case -20:
return "未知錯(cuò)誤. ";
default:
return "未知錯(cuò)誤.";
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -