请问这段VB代码,如果用ASP写,应该怎么写,急,谢谢
现在我们在华为的企业信息机上要进行短信的二次开发,以下是VB的发送代码格式,还有Delphi格式的,但就是没有asp格式的,内部有一个SMEntry.dll库提供,采用asp方式不知道如何引用。引用的过程如何的。
[VB]
函数声明:
Public Declare Function SubmitShortMessage Lib "SMEntry.dll" (ByVal AtTime As String, ByVal SourceAddr As String, ByVal DestAddr As String, ByVal Content As String, ByVal ContentLen As Long, ByVal NeedStateReport As Long, ByVal ServiceID As String, ByVal FeeType As String, ByVal FeeCode As String) As Long
调用代码:
Private Sub SubmitButton_Click()
Dim Ret As Long
Ret = SubmitShortMessage(SendTimeText.Text, SourceAddrText.Text, DestAddrText.Text, ContentText.Text, LenB(ContentText.Text), 1, “EIE”, “02”, “10”)
If Ret <> 0 Then
MsgBox "单发短信失败!RetCode=" & Ret
End If
End Sub
这是Delphi的。
[Delphi]
函数声明:
function SubmitShortMessage(AtTime : pchar ; SourceAddr : pchar;DestAddr : pchar; Content : pchar; ContentLen : Cardinal; NeedStateReport: integer; ServiceID: pchar; FeeType: pchar; FeeCode: pchar) : integer; stdcall; external 'SMEntry.dll' name 'SubmitShortMessage';
调用代码:
procedure TMainForm.SubmitButtonClick(Sender: TObject);
var
Ret : integer;
SendTime : string;
begin
SendTime := FormatDateTime('yyyy-MM-dd hh:mm:ss', SendTimePicker.DateTime);
Ret := SubmitShortMessage(pchar(SendTime), pchar(SourceAddrEdit.Text), pchar(DestAddrEdit.Text), pchar(ContentMemo.Lines.Text), Length(ContentMemo.Lines.Text), 1, ‘EIE’, ‘02’, ‘10);
If Ret <> 0 then
ShowMessage('RetCode='+IntToStr(Ret));