forked from dotnet/dotnet-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRegistryKey.xml
More file actions
2961 lines (2698 loc) · 203 KB
/
Copy pathRegistryKey.xml
File metadata and controls
2961 lines (2698 loc) · 203 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="RegistryKey" FullName="Microsoft.Win32.RegistryKey">
<TypeSignature Language="C#" Value="public sealed class RegistryKey : MarshalByRefObject, IDisposable" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit RegistryKey extends System.MarshalByRefObject implements class System.IDisposable" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<TypeSignature Language="DocId" Value="T:Microsoft.Win32.RegistryKey" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class RegistryKey
Inherits MarshalByRefObject
Implements IDisposable" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<TypeSignature Language="F#" Value="type RegistryKey = class
 inherit MarshalByRefObject
 interface IDisposable" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<TypeSignature Language="C++ CLI" Value="public ref class RegistryKey sealed : MarshalByRefObject, IDisposable" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<TypeSignature Language="C#" Value="public sealed class RegistryKey : IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit RegistryKey extends System.Object implements class System.IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class RegistryKey
Implements IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="F#" Value="type RegistryKey = class
 interface IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<TypeSignature Language="C++ CLI" Value="public ref class RegistryKey sealed : IDisposable" FrameworkAlternate="netcore-1.0;netcore-1.1" />
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.MarshalByRefObject</BaseTypeName>
<BaseTypeName FrameworkAlternate="netcore-1.0;netcore-1.1">System.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IDisposable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a key-level node in the Windows registry. This class is a registry encapsulation.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To get an instance of <xref:Microsoft.Win32.RegistryKey>, use one of the static members of the <xref:Microsoft.Win32.Registry> class.
The registry acts as a central repository of information for the operating system and the applications on a computer. The registry is organized in a hierarchical format, based on a logical ordering of the elements stored within it (please see <xref:Microsoft.Win32.Registry> for the base-level items in this hierarchy). When storing information in the registry, select the appropriate location based on the type of information being stored. Be sure to avoid destroying information created by other applications, because this can cause those applications to exhibit unexpected behavior, and can also have an adverse effect upon your own application.
> [!IMPORTANT]
> This type implements the <xref:System.IDisposable> interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its <xref:System.IDisposable.Dispose*> method in a `try`/`catch` block. To dispose of it indirectly, use a language construct such as `using` (in C#) or `Using` (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the <xref:System.IDisposable> interface topic.
Registry keys are the base unit of organization in the registry, and can be compared to folders in File Explorer. A particular key can have subkeys, just as a folder can have subfolders. Each key can be deleted, as long as the user has the appropriate permissions to do so, and the key is not a base key or at the level directly under the base keys. Each key can also have multiple values associated with it (a value can be compared to a file), which are used to store the information - for example, information about an application installed on the computer. Each value holds one particular piece of information, which can be retrieved or updated when required. For instance, you can create a <xref:Microsoft.Win32.RegistryKey> for your company, under the key HKEY_LOCAL_MACHINE\Software, and then a subkey for each application that your company creates. Each subkey holds the information specific to that application, such as color settings, screen location and size, or recognized file extensions.
Note that information stored in the registry is available to other applications and users, and therefore should not be used to store security data or critical application information.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
Starting in the .NET Framework 4, the length of a registry key is no longer limited to 255 characters.
## Examples
The following code example shows how to create a subkey under HKEY_CURRENT_USER, manipulate its contents, and then delete the subkey.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:Microsoft.Win32.Registry" />
<altmember cref="T:Microsoft.Win32.RegistryHive" />
</Docs>
<Members>
<Member MemberName="Close">
<MemberSignature Language="C#" Value="public void Close ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Close() cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.Close" />
<MemberSignature Language="VB.NET" Value="Public Sub Close ()" />
<MemberSignature Language="F#" Value="member this.Close : unit -> unit" Usage="registryKey.Close " />
<MemberSignature Language="C++ CLI" Value="public:
 void Close();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Closes the key and flushes it to disk if its contents have been modified.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Calling this method on system keys will have no effect, because system keys are never closed.
This method does nothing if you call it on an instance of `RegistryKey` that is already closed.
## Examples
This code example is part of a larger example provided for the <xref:Microsoft.Win32.RegistryKey> class.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source.vb" id="Snippet4":::
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.Flush" />
</Docs>
</Member>
<MemberGroup MemberName="CreateSubKey">
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates a new subkey or opens an existing subkey.</summary>
</Docs>
</MemberGroup>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey subkey" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
<summary>Creates a new subkey or opens an existing subkey for write access.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed. If a zero-length string is specified for <paramref name="subkey" />, the current <see cref="T:Microsoft.Win32.RegistryKey" /> object is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In order to perform this action, the user must have permission at this level and below in the registry hierarchy.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
## Examples
The following code example shows how to create a subkey under HKEY_CURRENT_USER, manipulate its contents, and then delete the subkey.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.OpenSubKey(System.String,System.Boolean)" />
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> on which this method is being invoked is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The <see cref="T:Microsoft.Win32.RegistryKey" /> cannot be written to; for example, it was not opened as a writable key , or the user does not have the necessary access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key, or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, valuetype Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,Microsoft.Win32.RegistryKeyPermissionCheck)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, permissionCheck As RegistryKeyPermissionCheck) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * Microsoft.Win32.RegistryKeyPermissionCheck -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, permissionCheck)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, Microsoft::Win32::RegistryKeyPermissionCheck permissionCheck);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="permissionCheck" Type="Microsoft.Win32.RegistryKeyPermissionCheck" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
<param name="permissionCheck">One of the enumeration values that specifies whether the key is opened for read or read/write access.</param>
<summary>Creates a new subkey or opens an existing subkey for write access, using the specified permission check option.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed. If a zero-length string is specified for <paramref name="subkey" />, the current <see cref="T:Microsoft.Win32.RegistryKey" /> object is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In order to perform this action, the user must have permission at this level and below in the registry hierarchy.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
In order to use the <xref:Microsoft.Win32.RegistryKey.OpenSubKey*> method, you must have an instance of the <xref:Microsoft.Win32.RegistryKey> class. To get an instance of <xref:Microsoft.Win32.RegistryKey>, use one of the static members of the <xref:Microsoft.Win32.Registry> class.
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.OpenSubKey(System.String,System.Boolean)" />
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="permissionCheck" /> contains an invalid value.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> on which this method is being invoked is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The <see cref="T:Microsoft.Win32.RegistryKey" /> cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key, or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, bool writable);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, writable As Boolean) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * bool -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, writable)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, bool writable);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
<Parameter Name="writable" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
<param name="writable">
<see langword="true" /> to indicate the new subkey is writable; otherwise, <see langword="false" />.</param>
<summary>Creates a new subkey or opens an existing subkey with the specified access. Available starting with .NET Framework 4.6.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed. If a zero-length string is specified for <paramref name="subkey" />, the current <see cref="T:Microsoft.Win32.RegistryKey" /> object is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In order to perform this action, the user must have permission at this level and below in the registry hierarchy.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
In order to use the <xref:Microsoft.Win32.RegistryKey.CreateSubKey*> method, you must have an instance of the <xref:Microsoft.Win32.RegistryKey> class. To get an instance of <xref:Microsoft.Win32.RegistryKey>, use one of the static members of the <xref:Microsoft.Win32.Registry> class.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
<exception cref="T:System.UnauthorizedAccessException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key, or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, valuetype Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, valuetype Microsoft.Win32.RegistryOptions registryOptions) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,Microsoft.Win32.RegistryKeyPermissionCheck,Microsoft.Win32.RegistryOptions)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, permissionCheck As RegistryKeyPermissionCheck, registryOptions As RegistryOptions) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * Microsoft.Win32.RegistryKeyPermissionCheck * Microsoft.Win32.RegistryOptions -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, permissionCheck, registryOptions)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, Microsoft::Win32::RegistryKeyPermissionCheck permissionCheck, Microsoft::Win32::RegistryOptions registryOptions);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="permissionCheck" Type="Microsoft.Win32.RegistryKeyPermissionCheck" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="registryOptions" Type="Microsoft.Win32.RegistryOptions" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open.</param>
<param name="permissionCheck">One of the enumeration values that specifies whether the key is opened for read or read/write access.</param>
<param name="registryOptions">The registry option to use; for example, that creates a volatile key.</param>
<summary>Creates a subkey or opens a subkey for write access, using the specified permission check and registry options.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To obtain the current <xref:Microsoft.Win32.RegistryKey> object, specify an empty string ("") for `subkey`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.ObjectDisposedException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> object is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> object cannot be written to; for example, it was not opened as a writable key, or the user does not have the required access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistrySecurity? registrySecurity);" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-5.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, valuetype Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, class System.Security.AccessControl.RegistrySecurity registrySecurity) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,Microsoft.Win32.RegistryKeyPermissionCheck,System.Security.AccessControl.RegistrySecurity)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, permissionCheck As RegistryKeyPermissionCheck, registrySecurity As RegistrySecurity) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * Microsoft.Win32.RegistryKeyPermissionCheck * System.Security.AccessControl.RegistrySecurity -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, permissionCheck, registrySecurity)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, Microsoft::Win32::RegistryKeyPermissionCheck permissionCheck, System::Security::AccessControl::RegistrySecurity ^ registrySecurity);" />
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, System.Security.AccessControl.RegistrySecurity registrySecurity);" FrameworkAlternate="windowsdesktop-3.0;windowsdesktop-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="permissionCheck" Type="Microsoft.Win32.RegistryKeyPermissionCheck" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="registrySecurity" Type="System.Security.AccessControl.RegistrySecurity" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
<param name="permissionCheck">One of the enumeration values that specifies whether the key is opened for read or read/write access.</param>
<param name="registrySecurity">The access control security for the new key.</param>
<summary>Creates a new subkey or opens an existing subkey for write access, using the specified permission check option and registry security.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed. If a zero-length string is specified for <paramref name="subkey" />, the current <see cref="T:Microsoft.Win32.RegistryKey" /> object is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:Microsoft.Win32.RegistryKey.CreateSubKey*> method creates a registry key that has the access control specified by the `registrySecurity` parameter. The <xref:Microsoft.Win32.RegistryKey> object that is returned represents the registry key, but that object is not restricted by the access control specified in the `registrySecurity` parameter.
If `permissionCheck` is <xref:Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree?displayProperty=nameWithType>, the key is opened for read/write access. If `permissionCheck` is <xref:Microsoft.Win32.RegistryKeyPermissionCheck.ReadSubTree?displayProperty=nameWithType>, the key is opened for read access.
For backward compatibility, the key is opened for reading and writing if `permissionCheck` is <xref:Microsoft.Win32.RegistryKeyPermissionCheck.Default?displayProperty=nameWithType> and the parent key also has <xref:Microsoft.Win32.RegistryKeyPermissionCheck.Default?displayProperty=nameWithType>. If the parent key has any other setting, read/write status is controlled by the parent key's setting.
In order to perform this action, the user must have permissions at this level and below in the registry hierarchy.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
In order to use the <xref:Microsoft.Win32.RegistryKey.OpenSubKey*> method, you must have an instance of the <xref:Microsoft.Win32.RegistryKey> class. To get an instance of <xref:Microsoft.Win32.RegistryKey>, use one of the static members of the <xref:Microsoft.Win32.Registry> class.
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.OpenSubKey(System.String,System.Boolean)" />
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="permissionCheck" /> contains an invalid value.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> on which this method is being invoked is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key, or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, bool writable, Microsoft.Win32.RegistryOptions options);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, bool writable, valuetype Microsoft.Win32.RegistryOptions options) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,System.Boolean,Microsoft.Win32.RegistryOptions)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, writable As Boolean, options As RegistryOptions) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * bool * Microsoft.Win32.RegistryOptions -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, writable, options)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, bool writable, Microsoft::Win32::RegistryOptions options);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
<Parameter Name="writable" Type="System.Boolean" />
<Parameter Name="options" Type="Microsoft.Win32.RegistryOptions" />
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open. This string is not case-sensitive.</param>
<param name="writable">
<see langword="true" /> to indicate the new subkey is writable; otherwise, <see langword="false" />.</param>
<param name="options">The registry option to use.</param>
<summary>Creates a new subkey or opens an existing subkey with the specified access. Available starting with .NET Framework 4.6.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed. If a zero-length string is specified for <paramref name="subkey" />, the current <see cref="T:Microsoft.Win32.RegistryKey" /> object is returned.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In order to perform this action, the user must have permission at this level and below in the registry hierarchy.
> [!CAUTION]
> Do not expose <xref:Microsoft.Win32.RegistryKey> objects in such a way that a malicious program could create thousands of meaningless subkeys or key/value pairs. For example, do not allow callers to enter arbitrary keys or values.
In order to use the <xref:Microsoft.Win32.RegistryKey.CreateSubKey*> method, you must have an instance of the <xref:Microsoft.Win32.RegistryKey> class. To get an instance of <xref:Microsoft.Win32.RegistryKey>, use one of the static members of the <xref:Microsoft.Win32.Registry> class.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="options" /> does not specify a valid Option</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
<exception cref="T:System.UnauthorizedAccessException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> cannot be written to; for example, it was not opened as a writable key, or the user does not have the necessary access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key, or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
</Docs>
</Member>
<Member MemberName="CreateSubKey">
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions, System.Security.AccessControl.RegistrySecurity? registrySecurity);" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-5.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Microsoft.Win32.RegistryKey CreateSubKey(string subkey, valuetype Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, valuetype Microsoft.Win32.RegistryOptions registryOptions, class System.Security.AccessControl.RegistrySecurity registrySecurity) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String,Microsoft.Win32.RegistryKeyPermissionCheck,Microsoft.Win32.RegistryOptions,System.Security.AccessControl.RegistrySecurity)" />
<MemberSignature Language="VB.NET" Value="Public Function CreateSubKey (subkey As String, permissionCheck As RegistryKeyPermissionCheck, registryOptions As RegistryOptions, registrySecurity As RegistrySecurity) As RegistryKey" />
<MemberSignature Language="F#" Value="member this.CreateSubKey : string * Microsoft.Win32.RegistryKeyPermissionCheck * Microsoft.Win32.RegistryOptions * System.Security.AccessControl.RegistrySecurity -> Microsoft.Win32.RegistryKey" Usage="registryKey.CreateSubKey (subkey, permissionCheck, registryOptions, registrySecurity)" />
<MemberSignature Language="C++ CLI" Value="public:
 Microsoft::Win32::RegistryKey ^ CreateSubKey(System::String ^ subkey, Microsoft::Win32::RegistryKeyPermissionCheck permissionCheck, Microsoft::Win32::RegistryOptions registryOptions, System::Security::AccessControl::RegistrySecurity ^ registrySecurity);" />
<MemberSignature Language="C#" Value="public Microsoft.Win32.RegistryKey CreateSubKey (string subkey, Microsoft.Win32.RegistryKeyPermissionCheck permissionCheck, Microsoft.Win32.RegistryOptions registryOptions, System.Security.AccessControl.RegistrySecurity registrySecurity);" FrameworkAlternate="windowsdesktop-3.0;windowsdesktop-3.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Microsoft.Win32.RegistryKey</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" Index="0" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="permissionCheck" Type="Microsoft.Win32.RegistryKeyPermissionCheck" Index="1" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="registryOptions" Type="Microsoft.Win32.RegistryOptions" Index="2" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0" />
<Parameter Name="registrySecurity" Type="System.Security.AccessControl.RegistrySecurity" Index="3" FrameworkAlternate="net-10.0;net-11.0;net-6.0;net-7.0;net-8.0;net-9.0;netstandard-2.0-pp;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0">
<Attributes>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(2)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(2)>]</AttributeName>
</Attribute>
</Attributes>
</Parameter>
</Parameters>
<Docs>
<param name="subkey">The name or path of the subkey to create or open.</param>
<param name="permissionCheck">One of the enumeration values that specifies whether the key is opened for read or read/write access.</param>
<param name="registryOptions">The registry option to use.</param>
<param name="registrySecurity">The access control security for the new subkey.</param>
<summary>Creates a subkey or opens a subkey for write access, using the specified permission check option, registry option, and registry security.</summary>
<returns>The newly created subkey, or <see langword="null" /> if the operation failed.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To obtain the current <xref:Microsoft.Win32.RegistryKey> object, specify an empty string ("") for `subkey`.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.ObjectDisposedException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> object is closed. Closed keys cannot be accessed.</exception>
<exception cref="T:System.UnauthorizedAccessException">The current <see cref="T:Microsoft.Win32.RegistryKey" /> object cannot be written to; for example, it was not opened as a writable key, or the user does not have the required access rights.</exception>
<exception cref="T:System.IO.IOException">The nesting level exceeds 510.
-or-
A system error occurred, such as deletion of the key or an attempt to create a key in the <see cref="F:Microsoft.Win32.Registry.LocalMachine" /> root.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to create or open the registry key.</exception>
</Docs>
</Member>
<MemberGroup MemberName="DeleteSubKey">
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Deletes the specified subkey.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DeleteSubKey">
<MemberSignature Language="C#" Value="public void DeleteSubKey (string subkey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteSubKey(string subkey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteSubKey (subkey As String)" />
<MemberSignature Language="F#" Value="member this.DeleteSubKey : string -> unit" Usage="registryKey.DeleteSubKey subkey" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteSubKey(System::String ^ subkey);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
</Parameters>
<Docs>
<param name="subkey">The name of the subkey to delete. This string is not case-sensitive.</param>
<summary>Deletes the specified subkey.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To delete child subkeys, use <xref:Microsoft.Win32.RegistryKey.DeleteSubKeyTree*>.
Use caution when deleting registry keys.
## Examples
The following example demonstrates how to use <xref:Microsoft.Win32.RegistryKey.DeleteSubKey*>.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source2.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source2.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source2.vb" id="Snippet5":::
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKeyTree(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteValue(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.GetSubKeyNames" />
<exception cref="T:System.InvalidOperationException">The <paramref name="subkey" /> has child subkeys</exception>
<exception cref="T:System.ArgumentException">The <paramref name="subkey" /> parameter does not specify a valid registry key</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" /></exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to delete the key.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> being manipulated is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The user does not have the necessary registry rights.</exception>
</Docs>
</Member>
<Member MemberName="DeleteSubKey">
<MemberSignature Language="C#" Value="public void DeleteSubKey (string subkey, bool throwOnMissingSubKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteSubKey(string subkey, bool throwOnMissingSubKey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteSubKey (subkey As String, throwOnMissingSubKey As Boolean)" />
<MemberSignature Language="F#" Value="member this.DeleteSubKey : string * bool -> unit" Usage="registryKey.DeleteSubKey (subkey, throwOnMissingSubKey)" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteSubKey(System::String ^ subkey, bool throwOnMissingSubKey);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
<Parameter Name="throwOnMissingSubKey" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="subkey">The name of the subkey to delete. This string is not case-sensitive.</param>
<param name="throwOnMissingSubKey">Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is <see langword="true" /> and the specified subkey does not exist, an exception is raised. If this argument is <see langword="false" /> and the specified subkey does not exist, no action is taken.</param>
<summary>Deletes the specified subkey, and specifies whether an exception is raised if the subkey is not found.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To delete child subkeys, use <xref:Microsoft.Win32.RegistryKey.DeleteSubKeyTree*>.
Use caution when deleting registry keys.
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKeyTree(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteValue(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.GetSubKeyNames" />
<exception cref="T:System.InvalidOperationException">
<paramref name="subkey" /> has child subkeys.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="subkey" /> does not specify a valid registry key, and <paramref name="throwOnMissingSubKey" /> is <see langword="true" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to delete the key.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> being manipulated is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The user does not have the necessary registry rights.</exception>
</Docs>
</Member>
<MemberGroup MemberName="DeleteSubKeyTree">
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Deletes a subkey and any child subkeys recursively, with optional exception handling.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DeleteSubKeyTree">
<MemberSignature Language="C#" Value="public void DeleteSubKeyTree (string subkey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteSubKeyTree(string subkey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteSubKeyTree(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteSubKeyTree (subkey As String)" />
<MemberSignature Language="F#" Value="member this.DeleteSubKeyTree : string -> unit" Usage="registryKey.DeleteSubKeyTree subkey" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteSubKeyTree(System::String ^ subkey);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
</Parameters>
<Docs>
<param name="subkey">The subkey to delete. This string is not case-sensitive.</param>
<summary>Deletes a subkey and any child subkeys recursively.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You must have appropriate permissions to delete the subkey and its tree.
> [!CAUTION]
> Deleting a particular key will remove all entries below the key in the tree. No warning will be provided. If you want to delete a subkey only when it has no child subkeys, use the <xref:Microsoft.Win32.RegistryKey.DeleteSubKey*> method.
## Examples
This code example is part of a larger example provided for the <xref:Microsoft.Win32.RegistryKey> class.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source.vb" id="Snippet4":::
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.CreateSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteValue(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.GetSubKeyNames" />
<altmember cref="P:Microsoft.Win32.RegistryKey.SubKeyCount" />
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">Deletion of a root hive is attempted.
-or-
<paramref name="subkey" /> does not specify a valid registry subkey.</exception>
<exception cref="T:System.IO.IOException">An I/O error has occurred.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to delete the key.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> being manipulated is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The user does not have the necessary registry rights.</exception>
</Docs>
</Member>
<Member MemberName="DeleteSubKeyTree">
<MemberSignature Language="C#" Value="public void DeleteSubKeyTree (string subkey, bool throwOnMissingSubKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteSubKeyTree(string subkey, bool throwOnMissingSubKey) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteSubKeyTree(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteSubKeyTree (subkey As String, throwOnMissingSubKey As Boolean)" />
<MemberSignature Language="F#" Value="member this.DeleteSubKeyTree : string * bool -> unit" Usage="registryKey.DeleteSubKeyTree (subkey, throwOnMissingSubKey)" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteSubKeyTree(System::String ^ subkey, bool throwOnMissingSubKey);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="subkey" Type="System.String" />
<Parameter Name="throwOnMissingSubKey" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="subkey">The name of the subkey to delete. This string is not case-sensitive.</param>
<param name="throwOnMissingSubKey">Indicates whether an exception should be raised if the specified subkey cannot be found. If this argument is <see langword="true" /> and the specified subkey does not exist, an exception is raised. If this argument is <see langword="false" /> and the specified subkey does not exist, no action is taken.</param>
<summary>Deletes the specified subkey and any child subkeys recursively, and specifies whether an exception is raised if the subkey is not found.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">An attempt was made to delete the root hive of the tree.
-or-
<paramref name="subkey" /> does not specify a valid registry subkey, and <paramref name="throwOnMissingSubKey" /> is <see langword="true" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="subkey" /> is <see langword="null" />.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The user does not have the necessary registry rights.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to delete the key.</exception>
</Docs>
</Member>
<MemberGroup MemberName="DeleteValue">
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Deletes the specified value from this key, and throws an exception if the value is not found.</summary>
</Docs>
</MemberGroup>
<Member MemberName="DeleteValue">
<MemberSignature Language="C#" Value="public void DeleteValue (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteValue(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteValue(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteValue (name As String)" />
<MemberSignature Language="F#" Value="member this.DeleteValue : string -> unit" Usage="registryKey.DeleteValue name" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteValue(System::String ^ name);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name of the value to delete.</param>
<summary>Deletes the specified value from this key.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
This code example is part of a larger example provided for the <xref:Microsoft.Win32.RegistryKey> class.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Microsoft.Win32.RegistryKey2/CPP/source.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/Microsoft.Win32/RegistryKey/Overview/source.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/Microsoft.Win32/RegistryKey/Overview/source.vb" id="Snippet3":::
]]></format>
</remarks>
<altmember cref="M:Microsoft.Win32.RegistryKey.DeleteSubKey(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.OpenSubKey(System.String,System.Boolean)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.GetValue(System.String)" />
<altmember cref="M:Microsoft.Win32.RegistryKey.GetValueNames" />
<altmember cref="P:Microsoft.Win32.RegistryKey.ValueCount" />
<exception cref="T:System.ArgumentException">
<paramref name="name" /> is not a valid reference to a value.</exception>
<exception cref="T:System.Security.SecurityException">The user does not have the permissions required to delete the value.</exception>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:Microsoft.Win32.RegistryKey" /> being manipulated is closed (closed keys cannot be accessed).</exception>
<exception cref="T:System.UnauthorizedAccessException">The <see cref="T:Microsoft.Win32.RegistryKey" /> being manipulated is read-only.</exception>
</Docs>
</Member>
<Member MemberName="DeleteValue">
<MemberSignature Language="C#" Value="public void DeleteValue (string name, bool throwOnMissingValue);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void DeleteValue(string name, bool throwOnMissingValue) cil managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Win32.RegistryKey.DeleteValue(System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub DeleteValue (name As String, throwOnMissingValue As Boolean)" />
<MemberSignature Language="F#" Value="member this.DeleteValue : string * bool -> unit" Usage="registryKey.DeleteValue (name, throwOnMissingValue)" />
<MemberSignature Language="C++ CLI" Value="public:
 void DeleteValue(System::String ^ name, bool throwOnMissingValue);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Win32.Registry</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
<AssemblyVersion>4.1.3.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>