Click here to Skip to main content
15,914,500 members
Home / Discussions / C#
   

C#

 
QuestionRetrieve Installation Path Pin
terrible835-Jul-07 4:09
terrible835-Jul-07 4:09 
AnswerRe: Retrieve Installation Path Pin
originSH5-Jul-07 4:13
originSH5-Jul-07 4:13 
AnswerRe: Retrieve Installation Path Pin
led mike5-Jul-07 4:39
led mike5-Jul-07 4:39 
Questionhow to insert data Pin
csanda15-Jul-07 3:59
csanda15-Jul-07 3:59 
AnswerRe: how to insert data Pin
led mike5-Jul-07 4:42
led mike5-Jul-07 4:42 
QuestionRegistry Problems NullException Pin
StevenWalsh5-Jul-07 3:47
StevenWalsh5-Jul-07 3:47 
AnswerRe: Registry Problems NullException Pin
Christian Graus5-Jul-07 3:55
protectorChristian Graus5-Jul-07 3:55 
AnswerRe: Registry Problems NullException Pin
NassosReyzidis5-Jul-07 3:56
NassosReyzidis5-Jul-07 3:56 
Hello Steven,
either the RemoteKey is null or
the "RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed", RegistryKeyPermissionCheck.ReadSubTree)" is null

change your code from:
RegistryKey RemoteKey;<br />
string RemoteComputer = LabName + "isp0001";<br />
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);<br />
string value = RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed", RegistryKeyPermissionCheck.ReadSubTree).GetValue("1.3", 0).ToString();


to:
RegistryKey RemoteKey;<br />
RegistryKey RemoteSubKey;<br />
string value;<br />
string RemoteComputer = LabName + "isp0001";<br />
RemoteKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, RemoteComputer);<br />
if (RemoteKey != null)<br />
{<br />
     RemoteSubKey = RemoteKey.OpenSubKey("SOFTWARE\\Twrap\\Packages\\Completed",RegistryKeyPermissionCheck.ReadSubTree);<br />
     if (RemoteSubKey != null)<br />
     {<br />
          value = RemoteSubKey.GetValue("1.3", 0).ToString();<br />
     }<br />
}<br />
if (value != null && value.Length>0)<br />
{<br />
   //The SubKey exist do your staff with the value<br />
}


GanDad

GeneralRe: Registry Problems NullException Pin
StevenWalsh5-Jul-07 4:09
StevenWalsh5-Jul-07 4:09 
GeneralRe: Registry Problems NullException Pin
Christian Graus5-Jul-07 4:22
protectorChristian Graus5-Jul-07 4:22 
GeneralRe: Registry Problems NullException Pin
StevenWalsh5-Jul-07 4:42
StevenWalsh5-Jul-07 4:42 
Questionuser id,password.etcc.. Pin
myat_035-Jul-07 3:05
myat_035-Jul-07 3:05 
JokeRe: user id,password.etcc.. Pin
originSH5-Jul-07 3:10
originSH5-Jul-07 3:10 
GeneralRe: user id,password.etcc.. Pin
myat_035-Jul-07 3:25
myat_035-Jul-07 3:25 
GeneralRe: user id,password.etcc.. Pin
originSH5-Jul-07 3:36
originSH5-Jul-07 3:36 
GeneralRe: user id,password.etcc.. Pin
Christian Graus5-Jul-07 3:56
protectorChristian Graus5-Jul-07 3:56 
AnswerRe: user id,password.etcc.. Pin
Christian Graus5-Jul-07 3:19
protectorChristian Graus5-Jul-07 3:19 
AnswerRe: user id,password.etcc.. Pin
Paul Conrad5-Jul-07 6:02
professionalPaul Conrad5-Jul-07 6:02 
QuestionChange column title in DataGrid Pin
Muhammad Gouda5-Jul-07 2:20
Muhammad Gouda5-Jul-07 2:20 
AnswerRe: Change column title in DataGrid Pin
kubben5-Jul-07 2:28
kubben5-Jul-07 2:28 
GeneralRe: Change column title in DataGrid Pin
Muhammad Gouda9-Jul-07 21:21
Muhammad Gouda9-Jul-07 21:21 
Questionmp3 seek [modified] Pin
tradakad5-Jul-07 2:09
tradakad5-Jul-07 2:09 
AnswerRe: mp3 seek Pin
Christian Graus5-Jul-07 2:19
protectorChristian Graus5-Jul-07 2:19 
GeneralRe: mp3 seek Pin
tradakad5-Jul-07 2:42
tradakad5-Jul-07 2:42 
GeneralRe: mp3 seek Pin
Christian Graus5-Jul-07 2:53
protectorChristian Graus5-Jul-07 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.