PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
VS 2010 Need a master VB.Net guy/gal...-VBForums
Results 1 to 10 of 10

Thread: Need a master VB.Net guy/gal...

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2012
    Posts
    32

    Unhappy Need a master VB.Net guy/gal...

    I am in desperate need of help.... xD

    Here is what I have so far.

    Code:
    Public Class Form1
    
        Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
    
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Close()
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Process.Start("D:\data\CCleaner\CCleaner.exe")
        End Sub
    
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Process.Start("D:\data\Manual.dat\Project2.application")
        End Sub
    
        Private Sub AboutToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem.Click
    
        End Sub
    
        Private Sub ToolStripTextBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripTextBox1.Click
    
        End Sub
    
        Private Sub AboutToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AboutToolStripMenuItem1.Click
            MessageBox.Show("Gator Computers, LLC PC Sales and Repair, Cell Phone and Flat Screen TV Repair 229 West Beacon ST. Philadelphia, MS 39350                                                               Phone: (601)-656-0178                                                                                                        eMail:  Michael@gatorcomputers.net - Matt@gatorcomputers.net                                                                                                                                                                  Website: Http://wwww.gatorcomputers.net                                                                                                                                                                                                              This Programs GUI was made by Matthew Kaulfers a Gators Computer employee. All rights reserved 2012.")
        End Sub
    End Class
    Now in the section of
    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Process.Start("D:\data\CCleaner\CCleaner.exe")
        End Sub
    It will have another just like it but with different directories to another program so this section will look like this.

    Code:
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Process.Start("D:\data\CCleaner\CCleaner.exe")
        End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Process.Start("D:\data\malwarebytes\mbam.exe")
        End Sub
    What do i need to make the second one launch after the first one is finished and what else do I need to make the first one start automatically... I am a newbie yes i know...

    Then on this section

    Code:
    \Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            Process.Start("D:\data\Manual.dat\Project2.application")
        End Sub
    How do i get the code to select the disk drive either it be C:, D:, E:, F:,G: etc. Right now it only selects drive D:/ which some computers obviously have different disk drives.

  2. #2
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    Re: Need a master VB.Net guy/gal...

    To start one process first and when it has finished, start another, you could do it like this:
    vb.net Code:
    1. Dim psi1 As ProcessStartInfo = New ProcessStartInfo("notepad")
    2.         Dim psi2 As ProcessStartInfo = New ProcessStartInfo("notepad")
    3.  
    4.         Process.Start(psi1).WaitForExit() '<--- This is the key
    5.         Process.Start(psi2)
    It starts one notepad process first, and when it has been exited, another notepad opens.

    *EDIT* And to get the root drive of where Windows is installed, you can basically do something like this:
    vb.net Code:
    1. Dim root As String = IO.Path.GetPathRoot(My.Computer.FileSystem.SpecialDirectories.ProgramFiles).ToString()
    Last edited by Zeelia; Jan 4th, 2012 at 06:12 PM.

  3. #3
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Need a master VB.Net guy/gal...

    You will get more help if you give a hint of what you need on the thread description.
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

  4. #4
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,464

    Re: Need a master VB.Net guy/gal...

    you are very new to this worlk

    from your description you are trying to make acd that can be used to repair (or should I say clean) client computers.

    and you have fallen at he first hurdle!

    it is clear from your code that you have little clue about coding

    as you have a number of subs unused!

    suggestive of someone who has merely placed and clicked a few things on a form in the hope of build ing some thing

    it sould be better if you drew out your planned interface and then we could help you fill in your knowledge gaps

    The short commings of what you are attempting is that of suitable platform i.e. os that is appropriate for the tools and can support them during its time of trouble.

    That problem is often overcome by building a preinstall environment , which you appear to have not bothered with.

    And the other main issue is that of updating the toolset you present to the client when the platform cannot get to the web due to the infection.

    here to point you towards such helpful discs and to build yours if you need/want help

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2012
    Posts
    32

    Re: Need a master VB.Net guy/gal...

    Quote Originally Posted by incidentals View Post
    you are very new to this worlk

    from your description you are trying to make acd that can be used to repair (or should I say clean) client computers.

    and you have fallen at he first hurdle!

    it is clear from your code that you have little clue about coding

    as you have a number of subs unused!

    suggestive of someone who has merely placed and clicked a few things on a form in the hope of build ing some thing

    it sould be better if you drew out your planned interface and then we could help you fill in your knowledge gaps

    The short commings of what you are attempting is that of suitable platform i.e. os that is appropriate for the tools and can support them during its time of trouble.

    That problem is often overcome by building a preinstall environment , which you appear to have not bothered with.

    And the other main issue is that of updating the toolset you present to the client when the platform cannot get to the web due to the infection.

    here to point you towards such helpful discs and to build yours if you need/want help
    I appreciate the fact that you aren't oblivious to the fact that I'm not great at this and yes I have posted here bwcuase I haven't a clue what I'm doing else I wouldn't have posted. Now have you any idea what I should do with this or are you just a troll? As for the unuseed subs they will eventually be used I had some code in there but I was kind enough to remove it for the sake of posting on this website to make it easier to dexypher

  6. #6

    Thread Starter
    Member
    Join Date
    Jan 2012
    Posts
    32

    Re: Need a master VB.Net guy/gal...

    Quote Originally Posted by Zeelia View Post
    To start one process first and when it has finished, start another, you could do it like this:
    vb.net Code:
    1. Dim psi1 As ProcessStartInfo = New ProcessStartInfo("notepad")
    2.         Dim psi2 As ProcessStartInfo = New ProcessStartInfo("notepad")
    3.  
    4.         Process.Start(psi1).WaitForExit() '<--- This is the key
    5.         Process.Start(psi2)
    It starts one notepad process first, and when it has been exited, another notepad opens.

    *EDIT* And to get the root drive of where Windows is installed, you can basically do something like this:
    vb.net Code:
    1. Dim root As String = IO.Path.GetPathRoot(My.Computer.FileSystem.SpecialDirectories.ProgramFiles).ToString()
    Thank God that's exactly what I have been looking for I appreciate it so much. Now lets hope it'll work I'd love to get this program up and running. Tomorrow 1/5/2012 ill give it another try and see if I can get them to run appropriately.

  7. #7
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    Re: Need a master VB.Net guy/gal...

    Quote Originally Posted by Matthew.Kaulfers
    Yesterday you posted how to find a random drive.

    Here's an exerpt of what I have

    Code:
     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Process.Start("D:\data\CCleaner\CCleaner.exe").WaitForExit()
            Process.Start("D:\data\Malwarebytes\mbam.exe").waitforexit()
    The portion that is ("D:\data\CCleaner\CCleaner.exe") is a CD/DVD drive. Which from pc to pc is different. How would I write it to detect what the CD/DVD drive it on that particular pc?

    I tried the waitforexit() and it works perfectly. Only problem is that it seems to automatically start the next program without waiting for the exit of the first. Could it be because of the Pop up asking for administrator permission? or am I doing something wrong.
    To get the drive letter you could do this:
    vb.net Code:
    1. Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
    2. For Each drive As System.IO.DriveInfo In allDrives
    3.      If drive.DriveType = IO.DriveType.CDRom Then
    4.             'OK Now we have the CDRom
    5.             'You might want to check if there's a media inserted
    6.      End If
    7. Next
    (Credits to user stanav in this forum)

    As for that the program doesn't wait for exit, it could be the cause of that the first program only is a launcher to another program.

    For instance Program1 is started
    Program1 starts Program1_2 and then exits.
    Result is that Program1_2 is started and Program2 starts before Program1_2 exits.

    To avoid this, you can code in a hardcoded delay.

  8. #8
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    Re: Need a master VB.Net guy/gal...

    I usually use this delay since it doesn't pause the whole program
    vb.net Code:
    1. Dim d As Date = Date.Now
    2.         While Date.Now.Subtract(d).TotalMilliseconds < 1000
    3.             Application.DoEvents()
    4.         End While

    The time of the delay is in milliseconds (1000ms = 1 second).
    So the above example would thus have 1 second of delay.

  9. #9

    Thread Starter
    Member
    Join Date
    Jan 2012
    Posts
    32

    Re: Need a master VB.Net guy/gal...

    Quote Originally Posted by Zeelia View Post
    To get the drive letter you could do this:
    vb.net Code:
    1. Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
    2. For Each drive As System.IO.DriveInfo In allDrives
    3.      If drive.DriveType = IO.DriveType.CDRom Then
    4.             'OK Now we have the CDRom
    5.             'You might want to check if there's a media inserted
    6.      End If
    7. Next
    (Credits to user stanav in this forum)

    As for that the program doesn't wait for exit, it could be the cause of that the first program only is a launcher to another program.

    For instance Program1 is started
    Program1 starts Program1_2 and then exits.
    Result is that Program1_2 is started and Program2 starts before Program1_2 exits.

    To avoid this, you can code in a hardcoded delay.
    OK did the delay that has it working but I can't figure out how to make all ^^^^ work and still start the process. xD I haven't a gnikcuf clue so to speak.... xD

  10. #10
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    Re: Need a master VB.Net guy/gal...

    Within that code you had to get the drive letter from the variable/resource drive.

    For instance:

    vb.net Code:
    1. Dim driveletter As String = ""
    2.         Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
    3.         For Each drive As System.IO.DriveInfo In allDrives
    4.             If drive.DriveType = IO.DriveType.CDRom Then
    5.                 'OK Now we have the CDRom
    6.                 driveletter = drive.RootDirectory.ToString()
    7.             End If
    8.         Next

    Now you have the CDRom drive letter in the variable driveletter.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width