c# - AT commands appearing in the sms in asp.net -
i'm trying develop sms sending system using asp.net mvc 4 i'm using huawei usb 3g modem send sms. problem is, when receive sms, text coming this,
at+cmgf=1 at+cmgs="+8801671234567" name: sample name amount1: 1000.....
here codes,
public actionresult sendsms(int rentid=0) { amountinfo billtable = db.amountinfoes.find(rentid); var getname = db.amountinfoes.where(a => a.serial.equals(billtable.serial)).firstordefault(); string getname = getname.name; int getamount1 = getname.amount1; int getamount2 = getname.amount2; int getamount3 = getname.amount3; int getamount4 = getname.amount4; int getamount5 = getname.amount5; int getamount6 = getname.amount6; string getnumber = getname.phone; try { sp.portname = "com8"; sp.close(); sp.open(); string ph_no; string the_no = getnumber; string txt_msg = "name: " + getname + " amount1: " + getamount1 + " amount2: " + getamount2 + " amount3: " + getamount3 + " amount4: " + getamount4 + " amount5: " + getamount5 + " amount6: " + getamount6; ph_no = char.convertfromutf32(34) + the_no + char.convertfromutf32(34); sp.write("at+cmgf=1" + char.convertfromutf32(13)); sp.write("at+cmgs=" + ph_no + char.convertfromutf32(13)); sp.write(txt_msg + char.convertfromutf32(26) + char.convertfromutf32(13)); sp.close(); } catch (exception ex) { throw ex; } return redirecttoaction("rentmanager"); }
is there wrong in code? how can fix problem @ commands not appear in sms? need badly. thanks.
Comments
Post a Comment