This is a discussion on Best Torrent Client within the Networking & Internet Connectivity forums, part of the Computer Hardware/Software and Networking category; I use a seperate PC for torrent downloads and I keep it always on and always downloading to it's ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#31
| |||
| |||
| I use a seperate PC for torrent downloads and I keep it always on and always downloading to it's full bandwidth capacity to take the maximum out of my unlimited connection. By this way I usually gets a monthly download of atleast 80 GB. I use remote desktop from my office to monitor downloads at this PC at my home. But the problem is that I have a dynamic IP address connection. So I wont be able to connect to the remote desktop if the IP is changed... Is there any work around ? |
|
#32
| |||
| |||
| Well there are several solution for the classic Dynamic IP issue. One is that, you can use a third party utility like Ip Monitor. But I couldnt find a single utility that is freeware... I dont think spending money on these simple utilities is not fare. If you are a bit familiar to programming, you can write a simple java program that checks ur public IP address at a given interval of time (say, 5 mins), then compares it with the previous IP and if changed, sends a mail to an ID you wish. All sample code for getting Public IP, timers and sending mails are available very easily through google. |
|
#33
| |||
| |||
| Though I am not so familiar with programming, I think I will be able to do it in c# as .NET environment is such a wonderful programming environment for both beginners as well as experts. So it would be nice if I could get some code for c# than Java. |
|
#34
| |||
| |||
| Quote:
As you wish, here is the code to get the Public IP of your system... Make this part working with a small form and a label on it that shows the IP address and keeps it updated in every 5 mins or something... You can write the following code in a timer event which is set to a duration of 300000 milli second (5 mis)... Code: private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = getIP();
} The GetIP() fuction code is listed below... Code: private string getIP()
{
try
{
WebRequest myRequest = WebRequest.Create("http://network-tools.com");
using (WebResponse res = myRequest.GetResponse())
{
using (Stream s = res.GetResponseStream())
using (StreamReader sr = new StreamReader(s, Encoding.UTF8))
{
string html = sr.ReadToEnd();
Regex regex = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
string ipString = regex.Match(html).Value;
return ipString;
}
}
}
catch (Exception ex)
{
return "Error";
}
} Hopt this helps |
|
#35
| |||
| |||
| Thanks for the code snippet.... I have played around a bit and developed a small form that displays the current Public IP address of the system. The timer is set to 5 mins so, every 5 mins it checks for the IP. Now i need a way to send the IP to my mail ID if the IP changes.... How do I do that ? Code: namespace test4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = getIP();
}
private string getIP()
{
try
{
WebRequest myRequest = WebRequest.Create("http://network-tools.com");
using (WebResponse res = myRequest.GetResponse())
{
using (Stream s = res.GetResponseStream())
using (StreamReader sr = new StreamReader(s, Encoding.UTF8))
{
string html = sr.ReadToEnd();
Regex regex = new Regex(@"\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
string ipString = regex.Match(html).Value;
return ipString;
}
}
}
catch (Exception ex)
{
}
}
} |
|
#36
| |||
| |||
| Happy to hear that it worked for you... I didn't expect you to do it in the first try as you said you are not much familiar with programming. Congrats.... As for sending mail, you need to have access to any mail account that provides smtp access. Hope you have one. Once you have the server info, login info and content to be sent, it is just a matter of creating a SmtpClient object.... |
|
#37
| |||
| |||
| All credit goes to Microsoft Visual Studio .NET 's frindly environment.... That is the sole reason for my success in developing that part. And about the email account... Though I have my office ID that supports SMTP access, I would prefer using GMAIL for this service... Can u sent me a sample code that uses gmail for sending emails ? |
|
#38
| |||
| |||
| Hai That codes helped me too... Till now I was using a third party utility that kept nagging me about registering.... Thanks folks... Great and informative discussion going on... |
|
#39
| |||
| |||
| Hi... To send mail through gmail, you can use the folloing function... Code: public void SendMail(String ip)
{
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.To.Add("you@yahoo.com");
msg.From = new MailAddress("you@gmail.com", "IP Changed!!!", System.Text.Encoding.UTF8);
msg.Subject = ip;
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = "Your System ip changed to :"+ip +" at " +label4.Text ;
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = false;
msg.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("you@gmail.com","password");
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
object userState = msg;
try
{
client.SendAsync(msg, userState);
}
catch (System.Net.Mail.SmtpException ex)
{
}
} |
|
#40
| |||
| |||
| Oh... I think I missed the part that sets the port. you must add the line client.Port = 587; after you set client.Host = "smtp.gmail.com"; This is necessary... Anyway, I am posting the complete code again... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bit Torrent Tutorials | bluesky | Web Hosting Deals | 9 | 08-17-2009 02:15 AM |
| how to use jsp page as a EJP client.? | saravanan | Java Server Pages (JSP) | 0 | 03-19-2008 08:45 PM |
| winsock - client AND server | kesuu | Networking & Internet Connectivity | 0 | 12-23-2007 11:37 PM |
| How can we find the client’s IP Address Using C# .Net | Archer | C# Programming | 0 | 07-15-2007 11:11 PM |
| E-mail Client You Use ! Which One ? | killerkev06 | The Lounge | 2 | 03-29-2007 07:23 AM |
Our Partners |