C# Unreachable code detected

后端 未结 5 2448
抹茶落季
抹茶落季 2021-02-20 18:57

I\'m getting a \"Unreachable code detected\" message in Visual Studio at the point i++ in my code below. Can you spot what I\'ve done wrong?

try
{
    RegistryKe         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 19:37

    Although your problem is solved i need to tell you this, you can just using the CreateSubKey() method for your purpose. I think It's a better choice. :)

    //Creates a new subkey or opens an existing subkey for write access.
    var ourKey = Registry.CurrentUser.CreateSubKey("Software\\Resources\\Shared");
    

提交回复
热议问题