i am looking for a reference for the different things in visual basic. like, the different things you use for classes and things. i am new to vb, and tried using the help files, but i was looking for a quick reference. i am trying to make a console program
that gathers different info from a computer, like the os, computer name, programs installed, etc. i used my.computer.name to get the name, but have no clue where to find the rest of the information. i don't want someon to do the work for me, just point me
in the right direction. thanx,
I appreciate your efforts. Let's see if this can mark any item as complete on your list
(I wrote and tested following , in VB Express 2010)
This code gets you installed programs (you may want to filter out those mepty strings as, there might be some programs installed on your machine with this field kept blank.
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports Microsoft.Win32
Module Module1
Sub Main()
Dim registry_key As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
Using key As Microsoft.Win32.RegistryKey = Registry.LocalMachine.OpenSubKey(registry_key)
For Each subkey_name As String In key.GetSubKeyNames()
Using subkey As RegistryKey = key.OpenSubKey(subkey_name)
Console.WriteLine(subkey.GetValue("DisplayName"))
End Using
Next
End Using
End Sub
End Module
This one get you machine name :
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports Microsoft.Win32
Module Module1
Sub Main()
Console.WriteLine(System.Environment.MachineName)
End Sub
End Module
for OS, use "OperatingSystem" :
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion
Console.WriteLine(osInfo)
Like the guy above did, there's not another way to view your currently installed programs other than the registry as far as I know. Other things you can get by looking under the class "Environment" and under "My". For instance My.Computer.FileSystem has
a few properties and lots of functions.
The only thing I can say to do is go here and see if this helps:
i really appreciate the help guys. but the way i learn would be to have a reference to go to, like for instance, how did you figure what the the class environment did? Or that there even was a class my.computer.filesystem? I had a class on vb, but it
was only 6 weeks, the other 6 was in python, basically just an introduction. python i get really well, from the old days of basic (1984). vb, not so much. i got one book on vb that i went through, good one too. teach yourself vb in 24 hours, by james foxall.
loved it and it taught me a lot. at this rate it'll take me years to be able to use it effectively though. the link really helped, i had it bookmarked and have been reading it for two weeks, trying to get a website contact page working. then i took a break
and said i need a base, well back to the books i guess. thanx for the help.
Most people use C# now a days (if you have a choice to use it) ... I have nothing to do with "C# vs. VB.net" stuff as a matter of fact they are all same mostly as long as you stay in .NET ...
For your "how did you figured out..." question, its just a matter of practice of writing the code and googling, to be hoenst with you.
sfzombie13
0 Points
2 Posts
references for asp.net
Jan 25, 2013 08:22 PM|LINK
i am looking for a reference for the different things in visual basic. like, the different things you use for classes and things. i am new to vb, and tried using the help files, but i was looking for a quick reference. i am trying to make a console program that gathers different info from a computer, like the os, computer name, programs installed, etc. i used my.computer.name to get the name, but have no clue where to find the rest of the information. i don't want someon to do the work for me, just point me in the right direction. thanx,
aarsh
Participant
1547 Points
435 Posts
Re: references for asp.net
Jan 25, 2013 09:02 PM|LINK
Hello !
I appreciate your efforts. Let's see if this can mark any item as complete on your list
(I wrote and tested following , in VB Express 2010)
This code gets you installed programs (you may want to filter out those mepty strings as, there might be some programs installed on your machine with this field kept blank.
Imports System.Collections.Generic Imports System.Linq Imports System.Text Imports Microsoft.Win32 Module Module1 Sub Main() Dim registry_key As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" Using key As Microsoft.Win32.RegistryKey = Registry.LocalMachine.OpenSubKey(registry_key) For Each subkey_name As String In key.GetSubKeyNames() Using subkey As RegistryKey = key.OpenSubKey(subkey_name) Console.WriteLine(subkey.GetValue("DisplayName")) End Using Next End Using End Sub End ModuleThis one get you machine name :
Imports System.Collections.Generic Imports System.Linq Imports System.Text Imports Microsoft.Win32 Module Module1 Sub Main() Console.WriteLine(System.Environment.MachineName) End Sub End Modulefor OS, use "OperatingSystem" :
speshulk926
Participant
1035 Points
238 Posts
Re: references for asp.net
Jan 25, 2013 09:32 PM|LINK
Like the guy above did, there's not another way to view your currently installed programs other than the registry as far as I know. Other things you can get by looking under the class "Environment" and under "My". For instance My.Computer.FileSystem has a few properties and lots of functions.
The only thing I can say to do is go here and see if this helps:
http://msdn.microsoft.com/en-us/library/ms233805%28v=vs.100%29.aspx
sfzombie13
0 Points
2 Posts
Re: references for asp.net
Jan 26, 2013 03:51 PM|LINK
i really appreciate the help guys. but the way i learn would be to have a reference to go to, like for instance, how did you figure what the the class environment did? Or that there even was a class my.computer.filesystem? I had a class on vb, but it was only 6 weeks, the other 6 was in python, basically just an introduction. python i get really well, from the old days of basic (1984). vb, not so much. i got one book on vb that i went through, good one too. teach yourself vb in 24 hours, by james foxall. loved it and it taught me a lot. at this rate it'll take me years to be able to use it effectively though. the link really helped, i had it bookmarked and have been reading it for two weeks, trying to get a website contact page working. then i took a break and said i need a base, well back to the books i guess. thanx for the help.
ramiramilu
All-Star
97829 Points
14494 Posts
Re: references for asp.net
Jan 27, 2013 08:38 AM|LINK
thats a good choice, try VB unleashed - http://www.informit.com/store/visual-basic-2012-unleashed-9780672336317
Thanks,
JumpStart
aarsh
Participant
1547 Points
435 Posts
Re: references for asp.net
Jan 28, 2013 09:19 PM|LINK
Most people use C# now a days (if you have a choice to use it) ... I have nothing to do with "C# vs. VB.net" stuff as a matter of fact they are all same mostly as long as you stay in .NET ...
For your "how did you figured out..." question, its just a matter of practice of writing the code and googling, to be hoenst with you.
All the best ...