PDA

View Full Version : در خواست کدی که هر 5 دقیقه ی بار اتوماتیک ای پی را عوض کنه



hosseinghaheri
دوشنبه 15 اردیبهشت 1393, 21:24 عصر
سلام ، کدی میخوام که هر 5 دقیقه ی بار اتوماتیک ای پی را عوض کنه!
پیشا پیش ممنون از همه.

mortezasar
دوشنبه 15 اردیبهشت 1393, 21:30 عصر
سلام به این لینک ها سر بزن درباره موردی هست که شما میخواین




http://stackoverflow.com/questions/209779/how-can-you-change-network-settings-ip-address-dns-wins-host-name-with-code
http://www.codeproject.com/KB/miscctrl/IpAddrCtrlLib.aspx
http://www.codeproject.com/KB/IP/ChangingIPADDRESS.aspx

http://www.codeproject.com/Questions/459475/HOW-can-i-change-my-IP-using-csharp

hosseinghaheri
دوشنبه 15 اردیبهشت 1393, 21:54 عصر
درست چیزی نفهمیدم!
مثلا توی کد زیر به جای parameters و uri باید چی بزارم؟؟؟

private void HttpPost(string uri, string parameters)
{
WebRequest webRequest = WebRequest.Create(uri);
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.Method = "POST";
byte[] bytes = Encoding.ASCII.GetBytes(parameters);
Stream os = null;
try
{
webRequest.ContentLength = bytes.Length;
os = webRequest.GetRequestStream();
os.Write(bytes, 0, bytes.Length);
}
catch (WebException ex)
{ }
finally
{
if (os != null)
{
os.Close();
}
}
}