请问各位知道怎么用VB写一个发短信的程序吗~
或哪里有源程序?

解决方案 »

  1.   

    VERSION 5.00
    Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "msinet.ocx"
    Begin VB.Form SendFrm 
       BorderStyle     =   3  'Fixed Dialog
       Caption         =   "联通130手机短信发送程序"
       ClientHeight    =   3555
       ClientLeft      =   3690
       ClientTop       =   2025
       ClientWidth     =   4845
       LinkTopic       =   "Form1"
       MaxButton       =   0   'False
       MinButton       =   0   'False
       ScaleHeight     =   3555
       ScaleWidth      =   4845
       ShowInTaskbar   =   0   'False
       Begin InetCtlsObjects.Inet InetSend 
          Left            =   4080
          Top             =   240
          _ExtentX        =   1005
          _ExtentY        =   1005
          _Version        =   393216
       End
       Begin VB.TextBox TextMsg 
          BeginProperty Font 
             Name            =   "宋体"
             Size            =   12
             Charset         =   134
             Weight          =   400
             Underline       =   0   'False
             Italic          =   0   'False
             Strikethrough   =   0   'False
          EndProperty
          Height          =   1200
          Left            =   1080
          MultiLine       =   -1  'True
          TabIndex        =   8
          Text            =   "SendFrm.frx":0000
          Top             =   1680
          Width           =   3495
       End
       Begin VB.TextBox TextNo 
          BeginProperty Font 
             Name            =   "宋体"
             Size            =   12
             Charset         =   134
             Weight          =   400
             Underline       =   0   'False
             Italic          =   0   'False
             Strikethrough   =   0   'False
          EndProperty
          Height          =   360
          Left            =   1080
          TabIndex        =   7
          Text            =   " "
          Top             =   1230
          Width           =   1815
       End
       Begin VB.TextBox TextName 
          BeginProperty Font 
             Name            =   "宋体"
             Size            =   12
             Charset         =   134
             Weight          =   400
             Underline       =   0   'False
             Italic          =   0   'False
             Strikethrough   =   0   'False
          EndProperty
          Height          =   360
          Left            =   1080
          TabIndex        =   6
          Text            =   " "
          Top             =   750
          Width           =   1815
       End
       Begin VB.ComboBox ComboSex 
          BeginProperty Font 
             Name            =   "宋体"
             Size            =   12
             Charset         =   134
             Weight          =   400
             Underline       =   0   'False
             Italic          =   0   'False
             Strikethrough   =   0   'False
          EndProperty
          Height          =   360
          ItemData        =   "SendFrm.frx":0002
          Left            =   1080
          List            =   "SendFrm.frx":000C
          TabIndex        =   5
          Top             =   270
          Width           =   1335
       End
       Begin VB.CommandButton CmdSend 
          Caption         =   "发 送"
          Height          =   375
          Left            =   1080
          TabIndex        =   0
          Top             =   3000
          Width           =   1095
       End
       Begin VB.Label Label4 
          AutoSize        =   -1  'True
          Caption         =   "信息内容"
          Height          =   180
          Left            =   240
          TabIndex        =   4
          Top             =   1680
          Width           =   720
       End
       Begin VB.Label Label3 
          AutoSize        =   -1  'True
          Caption         =   "手机号码"
          Height          =   180
          Left            =   240
          TabIndex        =   3
          Top             =   1320
          Width           =   720
       End
       Begin VB.Label Label2 
          AutoSize        =   -1  'True
          Caption         =   "姓名"
          Height          =   180
          Left            =   600
          TabIndex        =   2
          Top             =   840
          Width           =   360
       End
       Begin VB.Label Label1 
          AutoSize        =   -1  'True
          Caption         =   "称呼"
          Height          =   180
          Left            =   600
          TabIndex        =   1
          Top             =   360
          Width           =   360
       End
    End
    Attribute VB_Name = "SendFrm"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As String) As LongPrivate Sub CmdSend_Click()
        my0 = ComboSex.Text
        If my0 = "先生" Then my00 = "0"
        If my0 = "小姐" Then my00 = "1"
        my1 = TextNo.Text
        n1 = lstrlen(my1 + Chr(0))
        my2 = TextMsg.Text
        n2 = lstrlen(my2 + Chr(0))
        my3 = TextName.Text
        
        
        If my1 = "" Or my2 = "" Or my3 = "" Or n1 < 10 Then
            MsgBox "没填写完整或填写有误!", vbExclamation, "出错"
        ElseIf Left(my1, 3) <> "130" Or n2 > 100 Then
            MsgBox "只能发130短信息,且发送内容不超过50个中文", vbExclamation, "出错"
        Else
            CmdSend.Enabled = False
            Me.Caption = "连接中...."
            InetSend.Protocol = icHTTP
            InetSend.Execute "http://sms.szunicom.com/cgi-bin/tims/webgsm?gsm_no=" & my1 & "&mobile_type=C&firstname=" & my3 & "&title=" & my00 & "&message=" & my2, "get"
        End If
    End SubPrivate Sub InetSend_StateChanged(ByVal State As Integer)
        Select Case State
            Case icHostResolvingHost
                Me.Caption = "连接中...."
            Case icConnecting
                Me.Caption = "连接中...."
            Case icError
                MsgBox "连接出错:无法连结", vbExclamation, "出错"
                Me.Caption = "联通130手机短信发送程序"
                TextName.Text = ""
                TextNo.Text = ""
                TextMsg.Text = ""
                CmdSend.Enabled = True
            Case icResponseCompleted
                Me.Caption = "联通130手机短信发送程序"
                MsgBox "短消息发送成功!", vbExclamation, "恭喜!"
                TextName.Text = ""
                TextNo.Text = ""
                TextMsg.Text = ""
                CmdSend.Enabled = True
        End Select
    End Sub
      

  2.   

    相关文章:http://expert.csdn.net/Expert/topic/1739/1739646.xml?temp=.5452387http://developer.ccidnet.com/pub/disp/Article?columnID=310&articleID=40965&pageNO=1http://www.simpleteam.com/http://expert.csdn.net/Expert/topic/1633/1633363.xml?temp=.8841669http://expert.csdn.net/Expert/topic/1348/1348037.xml?temp=.7235834http://expert.csdn.net/Expert/topic/1891/1891782.xml?temp=.7845575http://expert.csdn.net/Expert/topic/1763/1763055.xml?temp=.4391596http://expert.csdn.net/Expert/topic/1541/1541518.xml?temp=.7286493http://expert.csdn.net/Expert/topic/1935/1935071.xml?temp=.1317255http://expert.csdn.net/Expert/topic/1929/1929568.xml?temp=6.141299E-02http://expert.csdn.net/Expert/topic/1978/1978445.xml?temp=.7708856http://expert.csdn.net/Expert/topic/2015/2015600.xml?temp=.1674311http://www.spforum.net/jishu/page_1_2002121367.htmhttp://expert.csdn.net/Expert/topic/2043/2043826.xml?temp=.6380121http://expert.csdn.net/Expert/topic/2039/2039814.xml?temp=.6739618http://expert.csdn.net/Expert/topic/2031/2031927.xml?temp=.9868891http://expert.csdn.net/Expert/topic/1739/1739646.xml?temp=.8807794相关控件、软件http://www.dapha.net/down/list.asp?id=462http://transoft.com.cn/sms/Http://www.ChinaOK.net/down/IMNet_Pub.rarhref="http://www.truestone.net/sms/index.htm">http://www.truestone.net/sms/index.htmftp://showjidown:[email protected]/kkstar-sms-dll.ziphttp://www.csdn.net/cnshare/soft/15/15005.shtmhttp://www.csdn.net/cnshare/soft/14/14204.shtmhttp://www.mobset.com/product/soft/two.htmhttp://smsinterface.nease.nethttp://transoft.com.cn/sms/index.htmlhttp://www.csdn.net/cnshare/soft/17/17663.shtmhttp://www.csdn.net/Develop/article/17/17690.shtmhttp://www.mailer.com.cn/article/articleview/707/1/167/