S
Sid Price
I am having an issue reading a string value from the registry, with the
following code I get a pair of double quotes ("") at the start and end of
the string, this causes the method that processes the string to fail. Can
anyone advise what I am doing wrong please? Note that when I use regedit to
look at the value of the entry I do see it delimited by double quotes
("C:\Data Root\Projects\Pacific\Code\VistaMax\Tools 500 Series\VistaMax
Network Manager\VistaMaxRDS\bin\Release\VistaMaxRDS.exe"). The value
returned by GetValue is displayed like this in a watch window ""C:\Data
Root\Projects\Pacific\Code\VistaMax\Tools 500 Series\VistaMax Network
Manager\VistaMaxRDS\bin\Release\VistaMaxRDS.exe"".
Dim strRegKey As String = Registry.LocalMachine.ToString &
"\System\CurrentControlSet\Services\" _
& mService.ServiceName
Dim strImagePath As String = Registry.GetValue(strRegKey, "ImagePath", "")
Dim strPathOnly As String = System.IO.Path.GetFullPath(strImagePath) <-
this fails
Thanks,
Sid.
following code I get a pair of double quotes ("") at the start and end of
the string, this causes the method that processes the string to fail. Can
anyone advise what I am doing wrong please? Note that when I use regedit to
look at the value of the entry I do see it delimited by double quotes
("C:\Data Root\Projects\Pacific\Code\VistaMax\Tools 500 Series\VistaMax
Network Manager\VistaMaxRDS\bin\Release\VistaMaxRDS.exe"). The value
returned by GetValue is displayed like this in a watch window ""C:\Data
Root\Projects\Pacific\Code\VistaMax\Tools 500 Series\VistaMax Network
Manager\VistaMaxRDS\bin\Release\VistaMaxRDS.exe"".
Dim strRegKey As String = Registry.LocalMachine.ToString &
"\System\CurrentControlSet\Services\" _
& mService.ServiceName
Dim strImagePath As String = Registry.GetValue(strRegKey, "ImagePath", "")
Dim strPathOnly As String = System.IO.Path.GetFullPath(strImagePath) <-
this fails
Thanks,
Sid.