New VB.Net Version

Added by newlife 274 days ago

Hi Admin,
how are you?
long time to talk to you
i want to send my last vb.net version for your last library version
its now one form for both mms and sms
i think you will like this layout

and finaly thanks thanks for your great work


Replies

RE: New VB.Net Version - Added by stevensu 274 days ago

Hi Newlife,

I see from your demo.jpg you are using huawei mobile 3G. What model do you use. If the modem receive new message, does the modem receive +CNMI command or the new message is polled by using AT+CMGL=0?

RE: New VB.Net Version - Added by newlife 274 days ago

Hi Stevensu
I use E180.
I can receive new message,also i can Enable Message Indication
but you have to use (PC UI Interface) Port,and do not use the Modem port
In my case,the mode port is (3) and the PC UI Interface port is (5)
if i use the modem port i can send/recieve sms only.
but i cant use USSD,Message Indication,Call Indication,Or MMS
this is general for all HUAWEI models,you must use (PC UI Interface) for full features.
you can find this port as shown in the attached image.
I hope this help

Huawei.JPG (43.6 KB)

RE: New VB.Net Version - Added by stevensu 274 days ago

Ok, Thank you for your information. Do you the huawei AT Command ebook?
How to retrieve active port like in your demo.jpg attachment (deviceCombobox)?

Thank you,

RE: New VB.Net Version - Added by newlife 272 days ago

you are welcome brother,
about active port combobox,it is a part of the messaging toolkit demo,i just use it.

anyway:you can use this code to get list with all active modems with names and ports

=================================
Dim pc As String = "." 'local
Dim wmi As Object = GetObject("winmgmts:\\" & pc & "\root\cimv2")
Dim devices As SWbemObjectSet = wmi.ExecQuery("SELECT * FROM Win32_POTSModem WHERE Status = 'OK'") =================================

For Each d As SWbemObject In devices
ModemName = d.Name.ToString
ModemPort = d.attachedto.ToString
Next

but this will get all modem with direct ports,and if the modem has any other ports like huawei it will not return these ports

so you must try something else to get all ports
and to do so,you can use "SerialPort.GetPortNames"
put the only problem is that you will get only ports numbers and can not get devices name for this port,so you can not know this port device.

you can use namespace System.IO.Ports
and call
SerialPort.GetPortNames()

'##################### Working Solution #######################

after long time,I successed to Write a class to get a list of all active (Ports) with device names for all active Modems

you use the attached vb.net class
and use it like this

Dim ModemList As List(Of HardwareEnumerator.GSMModemPorts)
ModemList = HardwareEnumerator.DeviceInfo.EnumeratModemDevices
For Each s As HardwareEnumerator.GSMModemPorts In ModemList
nodeSubDevice = trvComputer.Nodes.Add(s.Name.ToString & "( " & s.Port & " )")
nodeSubDevice.Tag = s
Next

'#################################################################

hope this help

RE: New VB.Net Version - Added by stevensu 263 days ago

Hi NewLife,
Thank you for providing the hardware enumerator. How to add WbemScripting reference?

Thank you