[VB.NET] rickysModule

Discussion in 'Code Snippets and Tutorials' started by ricky92, Jul 4, 2007.

  1. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    The wrapper is just an HTTPRequest/Response wrapper with multithreading (the program won't stop running while downloading a page) and gZip support. It can also be a login panel if you set the "Visual Style" Property to LoginBox, but it can also just be a common wrapper.

    RickysWrapper 1.0.0 Features:
    • Visual Style (Login Panel / Wrapper only)
    • Included Login
    • OCR Scan
    • Proxy Support
    • gZip Streaming Decompression
    • Changeable UserAgent
    • Threaded Get/Post Requests


    RickysModule 1.0.1 Features:

    • GetBetween:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strString = GetBetween<span style="color: #000000;">(</span>strHTML, <span style="color: #808080;">"<HTML>"</span>, <span style="color: #808080;">"</HTML>"</span><span style="color: #000000;">)</span></li></ol></div>
    • MatchAll:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">Dim</span> arrLinks<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #FF8000;">as</span> <span style="color: #FF8000;">String</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">arrLinks = MatchAll<span style="color: #000000;">(</span>strHTML, <span style="color: #808080;">"<a href="</span> & <span style="color: #0600FF;">ChrW</span><span style="color: #000000;">(</span><span style="color: #FF0000;">34</span><span style="color: #000000;">)</span>, <span style="color: #0600FF;">ChrW</span><span style="color: #000000;">(</span><span style="color: #FF0000;">34</span><span style="color: #000000;">)</span> & <span style="color: #808080;">" >"</span><span style="color: #000000;">)</span></li></ol></div>

    • FileExists:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">If</span> FileExists<span style="color: #000000;">(</span>strPath<span style="color: #000000;">)</span> = <span style="color: #0600FF;">True</span> <span style="color: #FF8000;">Then</span>...</li></ol></div>

    • FolderExists:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">If</span> FolderExists<span style="color: #000000;">(</span>strPath<span style="color: #000000;">)</span> = <span style="color: #0600FF;">True</span> <span style="color: #FF8000;">Then</span>...</li></ol></div>

    • LoadList:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">LoadList<span style="color: #000000;">(</span>lstItems<span style="color: #000000;">)</span></li></ol></div>
    *Note: This function has a built-in OpenFileDialog, so you don't need any external path


    • SaveList:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">SaveList<span style="color: #000000;">(</span>lstLog<span style="color: #000000;">)</span></li></ol></div>
    *Note: This function has a built-in SaveFileDialog, so you don't need any external path


    • RemoveDupes:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0600FF;">MsgBox</span><span style="color: #000000;">(</span><span style="color: #808080;">"Removed "</span> & RemoveDupes<span style="color: #000000;">(</span>lstItems<span style="color: #000000;">)</span> & <span style="color: #808080;">" duplicates"</span><span style="color: #000000;">)</span></li></ol></div>

    • Wait:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">Wait<span style="color: #000000;">(</span><span style="color: #FF0000;">1000</span><span style="color: #000000;">)</span></li></ol></div>
    *Note: The expression is in ms (milliseconds)


    • MakeRandom:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">lngRandom = MakeRandom<span style="color: #000000;">(</span><span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">100</span><span style="color: #000000;">)</span></li></ol></div>

    • ParseLeft:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strString = ParseLeft<span style="color: #000000;">(</span>strHTML, <span style="color: #808080;">"</div>"</span><span style="color: #000000;">)</span></li></ol></div>

    • ParseRight:
    Code (vb.net):
    1. <div class="vbnet" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">strString = ParseRight<span style="color: #000000;">(</span>strHTML, <span style="color: #808080;">"<div>"</span><span style="color: #000000;">)</span></li></ol></div>
     
  2. Snowman

    Snowman Level IV

    Joined:
    Apr 9, 2007
    Messages:
    825
    Likes Received:
    0
    Nice module, i never thought of combining all my functions into a module. What about parseright and parseleft? Not sure if you use those but they're useful for me. + rep
     
  3. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Do you mean the functions like Left() and Right() in vb6? They still exists, just use Microsoft.VisualBasic.Left() and Microsoft.VisualBasic.Right()... ;)
     
  4. Snowman

    Snowman Level IV

    Joined:
    Apr 9, 2007
    Messages:
    825
    Likes Received:
    0
    Yeah, its probably the same thing. Parseright and parseleft delete code to the left and right of a specified word.
     
  5. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Ok, I get what you mean... I'll try and make them.
     
  6. Snowman

    Snowman Level IV

    Joined:
    Apr 9, 2007
    Messages:
    825
    Likes Received:
    0
    Oh so they are different from left() and right()? I can post the ones i use if a want so you can add them
     
  7. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Here they are:
    Code (Text):
    1.     Public Function ParseLeft(ByVal strSource As String, ByVal strEnd As String) As String
    2.         Return Microsoft.VisualBasic.Left(strSource, strSource.IndexOf(strEnd))
    3.     End Function
    4.     Public Function ParseRight(ByVal strSource As String, ByVal strStart As String) As String
    5.         Return Microsoft.VisualBasic.Right(strSource, strSource.Length - strSource.IndexOf(strStart) - strStart.Length)
    6.     End Function
    I'll add them to the module...
     
  8. xZel

    xZel Level I

    Joined:
    Jul 25, 2007
    Messages:
    85
    Likes Received:
    5
    Is the MatchAll function like an ExtractAll Function?
     
  9. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    yes, i am pretty sure that they are the same thing, and getbetweenall (or something like that, i dont use it) is also the same.
     
  10. impega

    impega Level III

    Joined:
    Dec 7, 2006
    Messages:
    408
    Likes Received:
    2
    Location:
    Nottingham (SHOTTS!)
    I'm really sorry, I must be retarded or something, because I can't find the download link?

    I bet there's a huge "DOWNLOAD ME" button somewhere on this page...
     
  11. Phee

    Phee Moderator
    Staff Member

    Joined:
    Aug 18, 2007
    Messages:
    6,206
    Likes Received:
    101
    At the bottom of the post:


    Attachments

    rickysWrapper.zip
    (22.39 KiB) Downloaded 49 times
     
  12. Justin X

    Justin X Newbie

    Joined:
    Aug 11, 2009
    Messages:
    2
    Likes Received:
    0
    I dont see the attachment...
     
  13. chelsea1

    chelsea1 Level IV

    Joined:
    Nov 26, 2006
    Messages:
    2,538
    Likes Received:
    31
    Location:
    London
    there is currently no attachment, i believe ricky removed it about a month ago
     
  14. Andromeda

    Andromeda Level I

    Joined:
    Aug 19, 2009
    Messages:
    44
    Likes Received:
    4
    Then what's the point of keeping the topic as a sticky...
     
  15. Rix

    Rix Level I

    Joined:
    Jan 2, 2010
    Messages:
    49
    Likes Received:
    1
    Yeah wondering the same thing...
    Can you post this module again? Would save me the time of writing each of these methods myself..