Click here to Skip to main content
16,004,452 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why dictionary puts data inside [] mark? Pin
jsc4219-May-21 23:58
professionaljsc4219-May-21 23:58 
GeneralRe: Why dictionary puts data inside [] mark? Pin
Richard MacCutchan20-May-21 0:50
mveRichard MacCutchan20-May-21 0:50 
AnswerRe: Why dictionary puts data inside [] mark? Pin
BillWoodruff30-May-21 21:05
professionalBillWoodruff30-May-21 21:05 
QuestionGet folders like the one for mega, drop box Pin
Duc Axenn19-May-21 11:35
Duc Axenn19-May-21 11:35 
AnswerRe: Get folders like the one for mega, drop box Pin
Dave Kreskowiak19-May-21 11:58
mveDave Kreskowiak19-May-21 11:58 
GeneralRe: Get folders like the one for mega, drop box Pin
Duc Axenn19-May-21 13:45
Duc Axenn19-May-21 13:45 
GeneralRe: Get folders like the one for mega, drop box Pin
Dave Kreskowiak19-May-21 14:34
mveDave Kreskowiak19-May-21 14:34 
GeneralRe: Get folders like the one for mega, drop box Pin
Duc Axenn19-May-21 21:27
Duc Axenn19-May-21 21:27 
Hi, i have an hexadecimal value for the return value.

I ask myself if i must continue to this way, i read somewhere else it was an old way to do it like a c++ copy/paste. I would to have something quick, with all default icons (i don't know another way for folders than to use win32.dll this is why i thought about make all with api methods)

Meanwhile, to go forward i found a way to get mega folders, i post here if it can help others.

var identity = System.Security.Principal.WindowsIdentity.GetCurrent();
string userName = identity.Name.ToString();
string userSID = identity.User.ToString();
List<string> MegaFolderPaths = new List<string>();

RegistryKey clsidKey = Registry.Users.OpenSubKey($"{userSID}\\Software\\Classes\\CLSID");

//Get all the sub keys it contains
foreach (string subKey in clsidKey.GetSubKeyNames())
{
    RegistryKey clsidSubKey = Registry.Users.OpenSubKey($"{userSID}\\Software\\Classes\\CLSID\\{subKey}\\Instance\\InitPropertyBag");

    if (clsidSubKey == null)
        continue;

    string defaultValue = (string)clsidSubKey.GetValue("TargetFolderPath");

    if (!string.IsNullOrEmpty(defaultValue))
        MegaFolderPaths.Add(defaultValue);
}


-------------------
Edit: for the chinese character i didn't see i forgot to add this
[DllImport("shell32.dll", CharSet = CharSet.Auto)]

above
public static extern Int32 SHGetFileInfo(IntPtr pIDL, uint dwFileAttributes,
                        out SHFILEINFO psfi, uint cbFileInfo, uint uFlags);


modified 21-May-21 3:29am.

QuestionIs ILMerge still used ? Pin
Maximilien19-May-21 9:05
Maximilien19-May-21 9:05 
AnswerRe: Is ILMerge still used ? Pin
Dave Kreskowiak19-May-21 9:48
mveDave Kreskowiak19-May-21 9:48 
QuestionString.Replace() & Regex.Replace() not working Pin
Mou_kol15-May-21 22:40
Mou_kol15-May-21 22:40 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Tony Hill15-May-21 23:30
professionalTony Hill15-May-21 23:30 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol15-May-21 23:36
Mou_kol15-May-21 23:36 
SuggestionRe: String.Replace() & Regex.Replace() not working Pin
Tony Hill16-May-21 0:04
professionalTony Hill16-May-21 0:04 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol16-May-21 0:21
Mou_kol16-May-21 0:21 
AnswerRe: String.Replace() & Regex.Replace() not working Pin
OriginalGriff16-May-21 0:20
mveOriginalGriff16-May-21 0:20 
GeneralRe: String.Replace() & Regex.Replace() not working Pin
Mou_kol16-May-21 0:21
Mou_kol16-May-21 0:21 
AnswerRe: String.Replace() & Regex.Replace() not working Pin
Gerry Schmitz16-May-21 11:04
mveGerry Schmitz16-May-21 11:04 
QuestionBug in form font Pin
Ismael Oliveira 202112-May-21 4:12
Ismael Oliveira 202112-May-21 4:12 
QuestionRe: Bug in form font Pin
Richard MacCutchan12-May-21 5:26
mveRichard MacCutchan12-May-21 5:26 
AnswerRe: Bug in form font Pin
OriginalGriff12-May-21 5:27
mveOriginalGriff12-May-21 5:27 
AnswerRe: Bug in form font Pin
Ismael Oliveira 202117-May-21 10:08
Ismael Oliveira 202117-May-21 10:08 
GeneralRe: Bug in form font Pin
Richard MacCutchan17-May-21 21:05
mveRichard MacCutchan17-May-21 21:05 
AnswerRe: Bug in form font Pin
OriginalGriff12-May-21 5:26
mveOriginalGriff12-May-21 5:26 
GeneralRe: Bug in form font Pin
Ismael Oliveira 202117-May-21 10:06
Ismael Oliveira 202117-May-21 10:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.