Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

"Browse For Folder" dijalog u C#-u

[es] :: .NET :: .NET Desktop razvoj :: "Browse For Folder" dijalog u C#-u

[ Pregleda: 5117 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

tosa
上海, 中国

Član broj: 1811
Poruke: 1342
*.3.EUnet.yu

ICQ: 14293955
Sajt: https://github.com/milost..


+48 Profil

icon "Browse For Folder" dijalog u C#-u28.07.2002. u 13:29 - pre 263 meseci
verovatno je ovo nekome zatrebalo...
evo kako moze da se uradi:

1. "Add Reference" na \\winnt\\system32\\shell32.dll
2. dodati ovu funkciju u neku klasu ... i gotovo :)

Code:

public static string BrowseForFolder()
{    
    Shell32.IShellDispatch db = new Shell32.ShellClass();
    Shell32.Folder folder = db.BrowseForFolder(0,"Please choose directory",64 | 16 | 8 | 32 | 1 | 32768,null);
            
    if (folder!=null)
    {
        try
        {
             Shell32.Folder par = folder.ParentFolder;
             return par.ParseName(folder.Title).Path;
        }
        catch (System.IO.FileNotFoundException ee)
        {return null;}
        catch (System.NotImplementedException ee)
        {return null;}

        return null;
}
 
Odgovor na temu

[es] :: .NET :: .NET Desktop razvoj :: "Browse For Folder" dijalog u C#-u

[ Pregleda: 5117 | Odgovora: 0 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.