I found a C # source code that sends SMS with oxygen control with Oxygen control, try to debug it, and find it is really good, it is easy to use. However, it is not enough in the United States that will automatically add control company information in the sending SMS, and will cancel this information after registration, but registration requires a small fee. I downloaded the free PC Connectivity SDK3.0 directly on the Nokia website. After debugging, the same function can be achieved. The following procedure sends SMS successfully under the NOKIA8310 to connect to the computer under infrared. After installing SDK3.0, add the COM component Nokia Setting Adapter for PC Suite 3.7 and Nokiacl Messaging in the reference. Add reference: using sttngs3a_slib; using nokiaclMessaging; use system.text;
? Public void send_sms (string sms_number, string sms_content) // number parameter and transmits content data {try {STTNGS3A_SLib.PhoneInfo_Suite3 PhoneStatus = new STTNGS3A_SLib.PhoneInfo_Suite3 (); STTNGS3A_SLib.DevNotifyOpt devStatus; PhoneStatus.get_DeviceStatus (out devStatus);? / / is determined whether the phone is connected to if (devStatus.ToString () == "ATTACHED") on the PC {NokiaCLMessaging.ShortMsgAdapter smsObj = new NokiaCLMessaging.ShortMsgAdapterClass (); NokiaCLMessaging.ShortMessageItem smsEntry = new NokiaCLMessaging.ShortMessageItemClass (); smsEntry.Type = NokiaclMessaging.shortMessageType.shortMessage_type_gsm_submit; igsmsubmit submitobj = (igsmsubmit) SmSentry.TypeProperties;
// Conversion Code UnicodeEncoding Ustring = New UnicodeEncoding (); byte [] INPUT = Ustring.getBytes (SMS_Content.trim ());
SMS_CONTENT = system.text.encoding.uitode.getstring (input);
submitObj.Message = sms_content; submitObj.DestinationAddress = sms_number.Trim (); submitObj.ServiceCenterAddress = sms_center.Text.Trim ();? // message center number submitObj.DataCodingScheme = 8;? // use Unicode encoding submitObj.ValidityPeriodRelative = 255; Submitobj.Protocolid = 0;