Dennis445
Members-
Content Count
5 -
Joined
-
Last visited
Everything posted by Dennis445
-
I folks I am new here. I am looking for help on nslookup within a small Delphi app. What I am looking to accomplish is getting my external IP/Internet (Dynamic) address and having this program send me an email when it changes. I am developing software on Linux and need to be able to connect to this pc when I am away. This app will be running on a windows pc. This is the command line "nslookup myip.opendns.com resolver1.opendns.com" I need to extract the IP address from. I am not really sure how this can be done, is there a way to do this with out nslookup or a way to parse the information into a string? Thank you in advance.
-
Remy Lebeau, Nitpicking is great how else will I learn. Thank you for the advice. Will freeing up the idhttp clean that up? or any advice on how to do it better. I corrected the problem with using the url twice in the formcreate. and I did a <= for the timer as well as added the send mail procedure to it. I have to learn how to use the TIdHTTP.IOHandler.
-
I think I solved my question. I was just trying to be helpful with what I have discovered. I did a lot of searching and there wasn't much information on this. Sorry if this goes out of scope.
-
Hi Rollo62, once I get it all up and running the way I need it to be I probably will use php. Attila Kovacs, The way I need it to be temporally is to have a small program check what the current IP Address is and if it changes send me an email/text when it happens. On another note I migrated the code to my development pc with Win 11 on it and ran into an Indy problem with OpenSSL, I was able to fix it with installing Win32OpenSSL-0.9.8g_redist.msi. At some point when I have it all sorted out and with error checking and added the email portion of it I will share what I have learned.
-
So this is what I found out so far that works. I haven't added any error correction yet. I am just using Indy components. //when the for is created I get the initial ip address and store it in a variable then set the timer to active. procedure TForm1.FormCreate(Sender: TObject); begin idhttp := TIdHTTP.Create(nil); compare := idhttp.get('https://myexternalip.com/raw'); //great site that just displays the ip address so no parsing required. memo1.text := idhttp.get('https://myexternalip.com/raw'); Timer1.Enabled := true; end; //on the timer event I compare the current ip address with the stored variable and if it changes I set the new ip address to the stored variable. procedure TForm1.Timer1Timer(Sender: TObject); var ipaddress : string; begin idhttp := TIdHTTP.Create(nil); ipaddress := idhttp.get('https://myexternalip.com/raw'); if ipaddress = compare then memo1.lines.Add('No Change!') else compare := ipaddress; end; next part is adding error correction and the mail client using Indy comps. also I will add a setting menu so the user can add and store their information. I hope this helps someone or if someone want to expand on this please share your knowledge.