Click here to Skip to main content
13,449,902 members (57,089 online)
Rate this:
Please Sign up or sign in to vote.
See more:
iam using RegSaveKey API to save key but it is returning error code 123 what iam doing

What I have tried:

 [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern int RegSaveKey(UIntPtr hKey, [MarshalAs(UnmanagedType.LPStr)]string filename, IntPtr samDesired);

UIntPtr reg = UIntPtr.Zero;
string SaveFileName="myfilePath"

RegSaveKey(reg, SaveFileName, IntPtr.Zero);
Posted 3-Jan-18 1:30am
Updated 3-Jan-18 1:46am
F-ES Sitecore 3-Jan-18 7:38am
.net has its own classes for manipulating the registry, there is no point in using dll calls.
srilekhamenon 4-Jan-18 4:04am
what is there .net equivalent sir

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

From 'the documentation'[^]:
123 (0x7B)
The filename, directory name, or volume label syntax is incorrect.
srilekhamenon 3-Jan-18 8:05am
i have already checked the path and path is fine my path is

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01-2016 | 2.8.180318.3 | Last Updated 3 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100