Posts: 2,216
Threads: 187
Joined: Jul 2011
Hey SF, this is probably my most advanced program yet. I've been working on this for the past 3 hours and I'm actually quite satisfied with it! I can't really think of anything that needs adding/taking away/changing and it's all came together pretty well as an end result. I hit a few dumps in the road but finally got there! 'd like to know what you all think about this, I put a lot of effort into it. feelsgoodman
Program: HTML Grabber
Description: Grabs the HTML of website of which you input into the first textbox and puts it into the second text box.
Download: http://dl.dropbox.com/u/53794833/HTML%20Grabber.zip
Virus Scan: https://www.virustotal.com/file/918b0a6a...328534046/
Preview:
Before:
After:
Posts: 3,538
Threads: 348
Joined: Mar 2010
Reputation:
57
Advanced?? Breshie you can do better than this... It's alright but you're capable of better.
Posts: 5,793
Threads: 268
Joined: Sep 2010
Reputation:
85
02-06-2012, 07:17 AM
(This post was last modified: 02-06-2012, 07:18 AM by AceInfinity.)
I wouldn't believe that this took you 3 hours to make lol, but i've seen slightly better from you as well Breshie...
What code do you have? Why don't you ever post your code so people can help you out? If it took you 3 hours to do this you must have done something in a very inefficient manner which involves an extended amount of code. I could help you out, even if you still use VB6... (Not sure if you do or not).
Posts: 5,793
Threads: 268
Joined: Sep 2010
Reputation:
85
02-06-2012, 07:17 AM
(This post was last modified: 02-06-2012, 07:19 AM by AceInfinity.)
I wouldn't believe that this took you 3 hours to make lol, but i've seen slightly better from you as well Breshie...
What code do you have? Why don't you ever post your code so people can help you out? If it took you 3 hours to do this you must have done something in a very inefficient manner which involves an extended amount of code. I could help you out, even if you still use VB6... (Not sure if you do or not).
Edit: Oh great, it posted twice when I was just trying to make an edit. I thought there was an appending script to avoid having it post things twice so close together timewise? That would have saved me from this double post at the least, but not this time.
Posts: 3,538
Threads: 348
Joined: Mar 2010
Reputation:
57
Yeh you should post your code.. I'd be interested to see how you did it. You could do this in 3 minutes, so how it took you 3 hours, god knows.
Not trying to put your program down, but as I said before you can do miles better than this.
Posts: 5,793
Threads: 268
Joined: Sep 2010
Reputation:
85
He mentioned he added other stuff to it, like URL checking and resizing abilities through the code, so I was, and would have, only been judging it overall from a first glance without even seeing the code; 2-4 lines for the webrequest.downloadstring method.
Posts: 2,216
Threads: 187
Joined: Jul 2011
Source: http://dl.dropbox.com/u/53794833/HTML%20...source.zip
It wasn't the code/program that took the amount of time it did. It was all the tweaking/messing around I did with it. I know it's not advanced but for me, it is. I've learned a lot from this program and it's something I have never done before so I was quite pleased with it. Not any more though.
Posts: 5,793
Threads: 268
Joined: Sep 2010
Reputation:
85
02-06-2012, 08:19 AM
(This post was last modified: 02-06-2012, 08:19 AM by AceInfinity.)
Like I mentioned on my forum, no need to give up just from someone else throwing words at you when you were proud of the work yourself to begin with.
Here's how I would have done your application though:
Code: Private Sub GetURLSource_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetURLSource.Click
Dim wc As New WebClient()
RichTextBox1.Text = wc.DownloadString(TextBox1.Text)
End Sub
Private Sub Clear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Clear.Click
RichTextBox1.Clear()
End Sub
Private Sub CopyHTML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyHTML.Click
RichTextBox1.Copy()
End Sub
Private Sub SaveHTML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveHTML.Click
Dim sw As New StreamWriter("file.txt")
sw.Write(RichTextbox1.Text)
sw.Close()
sw.Dispose()
End Sub
In it's simplest form, without error handling or anything, that should do the trick.
Posts: 2,216
Threads: 187
Joined: Jul 2011
Yeah that's the most productive way, but I did it the way I did to learn from it, which I did. So what's so wrong with it? Haha.
Posts: 5,793
Threads: 268
Joined: Sep 2010
Reputation:
85
(02-06-2012, 08:24 AM)BreShiE Wrote: Yeah that's the most productive way, but I did it the way I did to learn from it, which I did. So what's so wrong with it? Haha.
Learning in itself is good, but if you look at it in a different light, it's probably more productive to learn the most optimized method of code for a particular function, as some methods are better than others. For reasons of performance, speed, safety/exception handling, memory & cpu conservation, etc...
With making a web request, see I would suggest multi-threading as well. Partly for speed, but also to prevent the GUI from locking up.
|