ShellExecute unter C# (Verzeichnis öffnen)
-
Hi, ich suche eine Möglichkeit wie ich ein Verzeichnis im Explorer öffnen kann.
Also so wie in C++ mit ShellExecute "Explore".
Danke schonmal, Elfblood
-
Servus,
System.Diagnostics.Process.Start("explorer", @"C:\Windows");
mfg
Hellsgore
-
Ah, danke.
Mal ne blöde Frage wie bekommt man sowas raus ?
Ich hab da schon wieder so eim Fall und komme mit MSDN und Suchen nicht weiter...Wie realisiere ich zb. GetPrivateProfileString() ?
-
Servus,
wenn du nichts direkt in der MSDN findest, dann benutze doch ersteinmal google.
Um GetPrivateProfileString() in C# zu benutzen benutzt du einfach PInvoke. Du holst dir den Rotz in dein Projekt so z.B.:
using System.Runtime.InteropServices; . . . [DllImport("user32.dll", EntryPoint = "PeekMessage", SetLastError = true, CharSet=CharSet.Auto, CallingConvention=CallingConvention.Winapi)] private static extern bool PeekMessage(ref MessageAPI lpMsg, Int32 hwnd, Int32 wMsgFilterMin, Int32 wMsgFilterMax, Int32 wRemoveMsg);
Das selbe dann halt für dieses GetProfileSchießmichtot. Ich weiss nicht was das macht und habe auch keine Lust mir darüber Gedanken zu machen
aber vielleicht gibt es soetwas schon in C#. Einfach mal nach dem Namen + C# googlen. Und für Infos für DllImport mal in der MSDN schauen oder googlen
mfg
Hellsgore