my landline phone is connected to my computer. Now in my asp.net website there is a textbox and a button . i filled a telephone number in the textbox and on button click i want that a call get connected to the no. in the textb开发者_C百科ox through my landline phone.
Is there any workaround for this in .net framework?
If it's connected to a MODEM in your computer you might be able to use .NET Serial Port communication to talk to the modem to get it to dial for you. Look at the Serial communication classes and your modem manual.
System.IO.Ports contains a class called SerialPort which you can use like this ...
var sp = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
sp.ReadTimeout = 5000;
sp.NewLine = "" + (char)13;
sp.WriteTimeout = 5000;
sp.DtrEnable = true;
sp.RtsEnable = true;
sp.Handshake = Handshake.None;
sp.Open();
SerialPort.DataReceived += new SerialDataReceivedEventHandler(SerialDataReceivedEventHandler);
Now you can send the appropriate autodial commands to the modem (ATDT ...) and you can create an event handler 'SerialDataReceivedEventHandler' to receive messages back from the modem.
精彩评论