着信番号を取得するには?
C#で着信番号を取得する方法は何ですか?
たとえば、Dial を呼び出すには、次のコードを使用します。
using System;
using System.IO;
using System.Net;
using System.Text;
public class FileConverter
{
static void Main(string[] args)
{
WebRequest request = WebRequest.Create("http://xx.xx.xx.xx/CGI/Execute HTTP/1.1");
request.Method = "POST";
string postData = @"XML=<CiscoIPPhoneExecute><ExecuteItem Priority=""0"" URL=""Dial:1566""/> </CiscoIPPhoneExecute>";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "text/xml; charset=\"UTF-8\"";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer);
reader.Close();
dataStream.Close();
response.Close();
}
}