![]() |
|
[.NET] Grabbing a webpage/webpage's php/java script 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] Grabbing a webpage/webpage's php/java script code (/showthread.php?tid=5467930) |
Grabbing a webpage/webpage's php/java script code - Phoenix_101VB.NET_DUDE - Nov 18, 2016 First have 1 textboxe and a richtextbox1, textbox1 for the url then have a button to display the code into richtextbox1. Then import System.IO Copy and paste this code into the button. Dim Str As System.IO.Stream Dim srRead As System.IO.StreamReader Try ' make a Web request Dim req As System.Net.WebRequest = System.Net.WebRequest.Create(TextBox1.Text) Dim resp As System.Net.WebResponse = req.GetResponse Str = resp.GetResponseStream srRead = New System.IO.StreamReader(Str) ' read all the text RichTextBox1.Text = srRead.ReadToEnd Catch ex As Exception RichTextBox1.Text = "Unable to download content" Finally ' Close Stream and StreamReader when done srRead.Close() Str.Close() End Try Done! 🤝 So far it only get the the webpage's code from .com domains, I've just been messing around with this.., when I have time I'll try to implement .net and shit, I just wanted to share this because it's a little interesting. 😎 Right..., seems like some people here don't know what I meant by it can't grab the code from .net domains I'm not completely sure that it can grab code from other domains I haven't had enough time to mess around with it more, when you copy and paste an url that has a .net domain it'll give you an error so I just thought that this can only get the webpage's code from a .com domain, so everyone that says I don't know what I'm talking aboutyou are correct like I said "I'm messing around with it" * - BahNahNah - Nov 18, 2016 If you are importing System.io, then why not replace Code System.IO.StreamCode StreamAnd while your at it, why not import System.Net too. * - Phoenix_101VB.NET_DUDE - Nov 18, 2016 (Nov 18, 2016 07:40 PM)BahNahNah Wrote: If you are importing System.io, then why not replace Well, people have different ways of doing it don't they? Anyway thanks for the help and I'm hangoverd as fuck so sorry for the fuck ups on my thread. 😊 * - $lick - Nov 18, 2016 > java script please no * - Ninja - Nov 18, 2016 Why not use using statements or dispose instead of close to free resources. Why not import namespaces so you dont have to write them out each time? * - Phoenix_101VB.NET_DUDE - Nov 18, 2016 (Nov 18, 2016 10:05 PM)Ninja Wrote: Why not use using statements or dispose instead of close to free resources. And..?, got a problem how I code? and CUZ FUCK IT * - DisguiserNET - Nov 19, 2016 You cant grab php code, its server sided. For the rest, new WebClient().DownloadString(url); should work * - Decim - Nov 19, 2016 (Nov 18, 2016 10:48 PM)Phoenix_101VB.NET_DUDE Wrote: And..?, got a problem how I code? Those are suggestions for you to improve yourself because don't seem to know what you're talking about. (Nov 18, 2016 07:25 PM)Phoenix_101VB.NET_DUDE Wrote: So far it only get the the webpage's code from .com domains, I've just been messing around with this.., when I have time I'll try to implement .net and shit
* - Visual Freedom - Nov 19, 2016 "Grabbing a webpage/webpage's php" You cannot grab the PHP code. * - Zilog80 - Nov 19, 2016 (Nov 18, 2016 07:25 PM)Phoenix_101VB.NET_DUDE Wrote: So far it only get the the webpage's code from .com domains, I've just been messing around with this.., when I have time I'll try to implement .net and shit, I just wanted to share this because it's a little interesting. 😎
* - $lick - Nov 19, 2016 (Nov 18, 2016 07:25 PM)Phoenix_101VB.NET_DUDE Wrote: So far it only get the the webpage's code from .com domains, I've just been messing around with this.., when I have time I'll try to implement .net and shit,
* - Delirium™ - Nov 19, 2016 (Nov 18, 2016 10:05 PM)Ninja Wrote: Why not use using statements or dispose instead of close to free resources. Close() calls Dispose() on StreamReader and Dispose() & GC.SuppressFinalize(this) on StreamWriter. His implementation of the streams is actually somewhat correct. Using statement will do the same job. It will create a try/finally block and close the streams accordingly. * - Phoenix_101VB.NET_DUDE - Nov 19, 2016 Right..., seems like some people here don't know what I meant by it can't grab the code from .net domains I'm not completely sure that it can grab code from other domains I haven't had enough time to mess around with it more, when you copy and paste an url that has a .net domain it'll give you an error so I just thought that this can only get the webpage's code from a .com domain, so everyone that says I don't know what I'm talking aboutyou are correct like I said "I'm messing around with it" * - Ninja - Nov 19, 2016 (Nov 19, 2016 03:57 PM)Phoenix_101VB.NET_DUDE Wrote: Right..., seems like some people here don't know what I meant by it can't grab the code from .net domains I'm not completely sure that it can grab code from other domains I haven't had enough time to mess around with it more, when you copy and paste an url that has a .net domain it'll give you an error so I just thought that this can only get the webpage's code from a .com domain, so everyone that says I don't know what I'm talking aboutyou are correct like I said "I'm messing around with it" The TLD literally does not matter when using a webrequest... |