![]() |
|
[.NET] Removing string from source code - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Removing string from source code (/showthread.php?tid=4924033) |
Removing string from source code - ninen2001 - Jul 27, 2015 First off, I guess some people will tell me "Use google you f*cking twat." But I've tried googling and watching tutorials and stuff but I just don't get it. Also, sorry for being extremely confusing. PM for my skype name and I'll try to explain better there if you are willing to help me. Hey! I want to try learn removing certain string from websites source code and maybe add some GeoIP feature to some program in the future. So I wanted to try to use freegeoip.com and get the info from the IP entered in my application and add it to a listbox. The source code of the info from freegoip.com is basically Code <IP>*ip*</IP>Code <IP>*ip*</IP>Code <title="Star Wars">* - LUOIdeRentA - Jul 27, 2015 If you'd like to learn regex, there are various websites that can help you out, such as these: Code https://regex101.com/If you go to the 2nd website and on the left hand side click "Cheatsheet", it shows you all that you can do with regex and explains what all the characters do. For the example that you provided: Code <IP>*ip*</IP>You can simple use this regex pattern: Code <IP>(.*)</IP>But, you can do the pattern properly so that it only searches for digits instead of every character like I did. Anyway, I hope this all helps. * - janko128 - Jul 27, 2015 (Jul 27, 2015 03:51 AM)ninen2001 Wrote: So I wanted to try to use freegeoip.com and get the info from the IP entered in my application and add it to a listbox. The source code of the info from freegoip.com is basically There is an alternative method you can use for getting information about the IP address that is entered in your application. Code Private Sub button1_Click(sender As System.Object, e As System.EventArgs) Handles button1.Clicktextbox1 would have the ip address you want to resolve listbox1 would then display the results, you can use a textbox instead. * - Josh - Jul 27, 2015 (Jul 27, 2015 05:21 AM)janko128 Wrote: There is an alternative method you can use for getting information about the IP address that is entered in your application. What is with the random "WebRequest.Create" which isn't used, why is a string not in "" and what has this got to to with OPs question? * - janko128 - Jul 27, 2015 (Jul 27, 2015 05:25 AM)Josh Wrote: What is with the random "WebRequest.Create" which isn't used, why is a string not in "" and what has this got to to with OPs question? Yeah i wrote this out on the thread and not on visual studio i missed the "" * - Josh - Jul 27, 2015 (Jul 27, 2015 05:30 AM)janko128 Wrote: Yeah i wrote this out on the thread and not on visual studio i missed the "" What's the point of the web request, seeing as you just use a web client to get the string * - log dot zip - Jul 27, 2015 Here's the actual way to do it. Of course, if you want more detailed info, just head to the API and look at the name for the values and add them yourself. ![]()
* - ninen2001 - Jul 27, 2015 (Jul 27, 2015 06:07 AM)codeconfusion Wrote: Here's the actual way to do it. Of course, if you want more detailed info, just head to the API and look at the name for the values and add them yourself. Thanks alot! I'll try this out. Thanks for all of the responses! (Jul 27, 2015 06:07 AM)codeconfusion Wrote: Here's the actual way to do it. Of course, if you want more detailed info, just head to the API and look at the name for the values and add them yourself. Thanks alot! This worked fine :D I didn't know anything about XML in VB.NET. XML just looked like the easiest format to cut the info out in. * - LUOIdeRentA - Jul 27, 2015 Now that I saw the options on the website, you could also use JSON if you prefer that. * - ninen2001 - Jul 27, 2015 (Jul 27, 2015 07:15 AM)thevegita730 Wrote: Now that I saw the options on the website, you could also use JSON if you prefer that. I have tried JSON before but I never understood it and my brain died after like 10 minutes of trying. XML was easier. (Jul 27, 2015 07:15 AM)thevegita730 Wrote: Now that I saw the options on the website, you could also use JSON if you prefer that. I have tried JSON before but I never understood it and my brain died after like 10 minutes of trying. XML was easier. * - ShittyAdvice - Jul 27, 2015 (Jul 27, 2015 07:18 AM)ninen2001 Wrote: I have tried JSON before but I never understood it and my brain died after like 10 minutes of trying. XML was easier. No offense but if you're serious about learning to program I'd say learning JSON is a "must". Obviously depending on what your goals are, but JSON is used so much it'll only come in handy if you learn it, especially when you're planning on working with API's which most of the time are limited to JSON. * - ninen2001 - Jul 27, 2015 (Jul 27, 2015 07:56 AM)ShittyAdvice Wrote: No offense but if you're serious about learning to program I'd say learning JSON is a "must". I am not serious about it though. I just do it for fun and if I'm bored and maybe make a program that helps me in some way. But I should still learn it. I just never found any good tutorials or anything. * - Odus - Jul 27, 2015 (Jul 27, 2015 07:56 AM)ShittyAdvice Wrote: No offense but if you're serious about learning to program I'd say learning JSON is a "must". Absolutely this. Don't worry if you don't completely understand it either, there are tools (some right within VS itself) which can make using JSON a no brainer. (Jul 27, 2015 06:07 AM)codeconfusion Wrote: -snip Enjoying C# 6.0's new string interpol I see haha * - ninen2001 - Jul 27, 2015 I may look into JSON later. It seems that alot of APIs use it such as VirusTotal. If someone could link me to a tutorial that would be great. |