some miscellaneous questions ...

G

Guest

hi, i have some questions about programming with visual basic .net ...

1) how do i display the Copyright icon properly? (the letter 'C' enclosed by
a circle)
2) how to detect the operating system of the computer using the class
library of .net framework 1.1?
3) how to determine the installation location of the executable file? (tits,
if the exe file is installed at C:\Program Files\vb program\vbasic.exe, how
do i determine the 'C:\Program Files\vb program\' within the program)

thanks a lot!
 
G

Guest

1. © copy paste or ALT 0169
2. System.Environment.OSVersion.ToString
3. Friend Shared ReadOnly Property Assemblypath() As String
Get
Return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())
End Get
End Property


hth

Michel Posseth [MCP]
 
P

Peter Proost

Hi to add to Michel,

If it's a winapp you can also use Application.StartupPath
And if you want some more information abouyt the windows you're running you
can also use wmi, you need to add a reference to system.management and a
multiline textbox called txtWindows for this to work:

Dim moReturn As Management.ManagementObjectCollection
Dim moSearch As Management.ManagementObjectSearcher
Dim mo As Management.ManagementObject
moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_OperatingSystem")
moReturn = moSearch.Get
For Each mo In moReturn
txtWindows.Text &= "Name: " & String.Format("{0}", mo("Caption")) &
vbCrLf
txtWindows.Text &= "Service Pack: " & String.Format("{0}",
mo("ServicePackMajorVersion")) & vbCrLf
txtWindows.Text &= "Version: " & String.Format("{0}", mo("Version")) &
vbCrLf
txtWindows.Text &= "Producent: " & String.Format("{0}",
mo("Manufacturer")) & vbCrLf
txtWindows.Text &= "Serialnumber: " & String.Format("{0}",
mo("SerialNumber")) & vbCrLf
Next

hth Greetz Peter
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)

M. Posseth said:
1. © copy paste or ALT 0169
2. System.Environment.OSVersion.ToString
3. Friend Shared ReadOnly Property Assemblypath() As String
Get
Return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Locati
on())
End Get
End Property


hth

Michel Posseth [MCP]

Xero said:
hi, i have some questions about programming with visual basic .net ...

1) how do i display the Copyright icon properly? (the letter 'C' enclosed by
a circle)
2) how to detect the operating system of the computer using the class
library of .net framework 1.1?
3) how to determine the installation location of the executable file? (tits,
if the exe file is installed at C:\Program Files\vb program\vbasic.exe, how
do i determine the 'C:\Program Files\vb program\' within the program)

thanks a lot!

--
Xero

http://www.chezjeff.net
My personal web portal
 
G

Guest

thanks again


--
Xero

http://www.chezjeff.net
My personal web portal


M. Posseth said:
1. © copy paste or ALT 0169
2. System.Environment.OSVersion.ToString
3. Friend Shared ReadOnly Property Assemblypath() As String
Get
Return
Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location())
End Get
End Property


hth

Michel Posseth [MCP]

Xero said:
hi, i have some questions about programming with visual basic .net ...

1) how do i display the Copyright icon properly? (the letter 'C' enclosed by
a circle)
2) how to detect the operating system of the computer using the class
library of .net framework 1.1?
3) how to determine the installation location of the executable file? (tits,
if the exe file is installed at C:\Program Files\vb program\vbasic.exe, how
do i determine the 'C:\Program Files\vb program\' within the program)

thanks a lot!

--
Xero

http://www.chezjeff.net
My personal web portal
 
H

Herfried K. Wagner [MVP]

Xero said:
3) how to determine the installation location of the executable file?
(tits,
if the exe file is installed at C:\Program Files\vb program\vbasic.exe,
how
do i determine the 'C:\Program Files\vb program\' within the program)

\\\
Imports System.IO
Imports System.Reflection
..
..
..
Private Function ApplicationPath() As String
Return _
Path.GetDirectoryName([Assembly].GetEntryAssembly().Location)
End Function
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top