Willkommen bei dotnet-snippets.de! Snippet hinzufügen Login Registrieren
Snippets in der Datenbank: 1563 | Anzahl registrierter User: 1896 | Besucher online: 151
Hauptmenü
Home
Top Ten
Zufälliger Snippet
FAQs
.NET Community
dotnet-forum.de
dotnet-kicks.de
Social

RSS Feeds
Rss Alle Snippets
Rss C#
Rss VB.NET
Rss C++
Rss ASP.NET
Partner
Member of Microsoft Community Leader/Insider Program (CLIP)

Nützliches aus der Registry


Autor: Volker Steitz
Sprache: VB.NET
Bewertung:
8.04 (6 votes)
Anzahl der Aufrufe: 7719
  
Kick it on dotnet-kicks.de  

Beschreibung:

manchmal braucht man ein paar Werte aus der Registry die einzelne oder alle User betreffen.

Hier ein kleiner Auszug. Die funktione liefern die Rückgabewerte aus - hoffentliche selbsterklärenden - Werten.

P.S.
Ich habe die Funktionen noch nicht unter Vista ausprobiert!


Abgelegt unter: Registry.



Visual Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
'Cu steht für CurrentUser

Public reg As Microsoft.Win32.Registry

Public Function CookiesPath() As String

        Return reg.Users.OpenSubKey(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cookies")

End Function

Public Function CuCookiesPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cookies")

End Function

Public Function CuRecentPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Recent")

End Function

Public Function CuDesktopPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Desktop")

End Function

Public Function CuFavoritesPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Favorites")

End Function

Public Function CuSendToPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("SendTo")

End Function

Public Function CuStartMenuPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Start Menu")

End Function

Public Function CuHistoryPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("History")

End Function

Public Function CuNetHoodPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("NetHood")

End Function

Public Function CuStartupPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Startup")

End Function

Public Function StartupPath() As String

        Return reg.Users.OpenSubKey(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Startup")

End Function

Public Function CommonStartupPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Startup")

End Function

Public Function CommonTemplatesPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Templates")

End Function

Public Function CommonDocumentsPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Documents")

End Function

Public Function CommonAdministrativeToolsPath() As String

     Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Administrative Tools")

End Function

Public Function CommonAppDataPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common AppData")

End Function

Public Function PersonalPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Personal")

End Function

Public Function MediaPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion").GetValue("MediaPath")

End Function

Public Function SystemRoot() As String

        Return reg.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue("SystemRoot")

End Function

Public Function GetCommonFilesPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion").GetValue("CommonFilesDir")

End Function

Public Function CachePath() As String

        Return reg.Users.OpenSubKey(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cache")

End Function

Sie haben Fragen zu diesem Snippet oder brauchen Hilfe bei der .NET Entwicklung?
Freundliche und kompetente Entwickler helfen Ihnen gern weiter im Forum für .NET Entwicklung.



Kommentare:
(Zum Schreiben von Kommentaren bitte anmelden.)



schlecht sehr gut
1 2 3 4 5 6 7 8 9 10
Nur angemeldete User können Snippets bewerten.