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: [email protected] - [email protected] 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.
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:
Dim psi1 As ProcessStartInfo = New ProcessStartInfo("notepad")
Dim psi2 As ProcessStartInfo = New ProcessStartInfo("notepad")
Process.Start(psi1).WaitForExit() '<--- This is the key
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:
Dim root As String = IO.Path.GetPathRoot(My.Computer.FileSystem.SpecialDirectories.ProgramFiles).ToString()
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.
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
Re: Need a master VB.Net guy/gal...
Quote:
Originally Posted by
incidentals
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
Re: Need a master VB.Net guy/gal...
Quote:
Originally Posted by
Zeelia
To start one process first and when it has finished, start another, you could do it like this:
vb.net Code:
Dim psi1 As ProcessStartInfo = New ProcessStartInfo("notepad")
Dim psi2 As ProcessStartInfo = New ProcessStartInfo("notepad")
Process.Start(psi1).WaitForExit() '<--- This is the key
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:
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.
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:
Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
For Each drive As System.IO.DriveInfo In allDrives
If drive.DriveType = IO.DriveType.CDRom Then
'OK Now we have the CDRom
'You might want to check if there's a media inserted
End If
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.
Re: Need a master VB.Net guy/gal...
I usually use this delay since it doesn't pause the whole program
vb.net Code:
Dim d As Date = Date.Now
While Date.Now.Subtract(d).TotalMilliseconds < 1000
Application.DoEvents()
End While
The time of the delay is in milliseconds (1000ms = 1 second).
So the above example would thus have 1 second of delay.
Re: Need a master VB.Net guy/gal...
Quote:
Originally Posted by
Zeelia
To get the drive letter you could do this:
vb.net Code:
Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
For Each drive As System.IO.DriveInfo In allDrives
If drive.DriveType = IO.DriveType.CDRom Then
'OK Now we have the CDRom
'You might want to check if there's a media inserted
End If
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
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:
Dim driveletter As String = ""
Dim allDrives() As System.IO.DriveInfo = System.IO.DriveInfo.GetDrives()
For Each drive As System.IO.DriveInfo In allDrives
If drive.DriveType = IO.DriveType.CDRom Then
'OK Now we have the CDRom
driveletter = drive.RootDirectory.ToString()
End If
Next
Now you have the CDRom drive letter in the variable driveletter.