Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SerialPort port = new SerialPort("COM36");
port.Open();
string t = port.ReadExisting();
Thread.Sleep(100);

string cmd = "ATD";
Thread.Sleep(100);
string phoneNumber = "";
Thread.Sleep(100);
port.WriteLine(cmd + phoneNumber + ";\r");

port.Close();

The error is access denied on COM36, I am not sure why
Posted

1 solution

The port either doesn't exist or is being held open by some other process.
 
Share this answer
 
Comments
polkj 27-Jul-14 0:49am    
the port is from my sansung mobile phone, I plug in my usb
Dave Kreskowiak 27-Jul-14 10:25am    
No. I meant "COM36" doesn't exist. It may come up as a different post ID. Look in Device Manager under Ports to see what it is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900