Losing accented characters getting account names from system

J

Jack Russell

I have the following code in VB .net 2003
s = "Select * from Win32_UserAccount WHERE Domain =""" +
Environment.MachineName.ToString + """"
moSearch = New Management.ManagementObjectSearcher(s)
moReturn = moSearch.Get
For Each mo In moReturn
Try
If mo("disabled").ToString = "False" Then
cboUsers.Items.Add(mo("name"))
End If
Catch e As Exception
ReportBug(e, "makinguserlist in
programoptions_initform")
End Try
Next

On some PCs (usually laptops) if the name contains any accented
characters (äüöéèà) those characters are lost.

Any ideas, the PCs in question can display those characters elsewhere

Thanks

Jack Russell
 
J

Jack Russell

Cor,

Compared the code pages between working and non working, the non working
actually had more!

Any other ideas?

Thanks

Jack
 
J

Jack Russell

Turns out to be a Windows bug. My user had created his user name by
renaming an existing name. for some reason this does not always return
the new user name. I am sure there is more to it but really do not want
to know.

Jack Russell
 

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