Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


depressed about this


depressed about this

Author
Message
Nataly
Nataly
Forum God
Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)Forum God (7.4K reputation)

Group: Forum Members
Posts: 60, Visits: 175
hey all, well, started learning C# and weirdly I like it.. but it's a littly complicated (sometimes) Tongue



Ok well my I've me a program it's just tool's for my little home network.. Only thing I have left to do is reading the registy key [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\ "shared"]

to check the path to the shared folder.. this path is always updated so I will always be able to find the folder if it's moved (i like this idea!)



but I've had alot of trouble coding it even after tutorials Angry

I just need it to show me the path to the shared folder by reading that registly key. Sad



I guess Im just asking you to show me how it's done, I truly give up on this and reading tutorials Crying





it's more fun to color outside the lines

TBone
TBone
Forum God
Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)Forum God (6.3K reputation)

Group: Forum Members
Posts: 38, Visits: 45
using System;
using Microsoft.Win32;
namespace MyNameSpace
{
        public class Registry
        {
                public Registry()
                {
                }
                public bool CreateKey(RegistryHive RootKey, string
SubKey)
                {
                        bool blRetVal;
                        RegistryKey RKey =
RegistryKey.OpenRemoteBaseKey(RootKey,String.Empty);
                        blRetVal = false;
                        try
                        {
                                RegistryKey RSubKey =
RKey.CreateSubKey(SubKey);
                                blRetVal = true;
                                RSubKey.Close();
                        }
                        catch
                        {
                                blRetVal = false;
                        }
                        RKey.Close();
                        return blRetVal;
                }
                public object GetValue(RegistryHive RootKey, string
SubKey, string ValueName, object DefaultValue)
                {
                        object oRetVal;
                        RegistryKey RKey =
RegistryKey.OpenRemoteBaseKey(RootKey,String.Empty);
                        oRetVal = null;
                        try
                        {
                                RegistryKey RSubKey =
RKey.OpenSubKey(SubKey);
                                oRetVal = RSubKey.GetValue(ValueName,
DefaultValue);
                                RSubKey.Close();
                        }
                        catch
                        {
                                oRetVal = DefaultValue;
                        }
                        RKey.Close();
                        return oRetVal;
                }
                public bool SetValue(RegistryHive RootKey, string
SubKey, string ValueName, object Value)
                {
                        bool blRetVal;
                        RegistryKey RKey =
RegistryKey.OpenRemoteBaseKey(RootKey,String.Empty);
                        blRetVal = false;
                        try
                        {
                                RegistryKey RSubKey =
RKey.OpenSubKey(SubKey,true);
                                RSubKey.SetValue(ValueName, Value);
                                RSubKey.Close();
                                blRetVal = true;
                        }
                        catch
                        {
                                blRetVal = false;
                        }
                        RKey.Close();
                        return blRetVal;
                }
        }

}

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search