Autor Beitrag
Levsen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Sa 23.02.08 16:53 
Hallo ich möchte wissen wie man mit C# denn Papierkorb leer.

Ich möchte das wenn man auf eine Button klick [csei mir ein Bild anstatt ein Button] der Papierkorb geleert wird.

Momentan siehst bei mir so aus weis aber net weiter

ausblenden C#-Quelltext
1:
2:
3:
4:
        private void trash_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("C:\\RECYCLED\\*.*");
        }


Vielen Dank im VORAUS

Moderiert von user profile iconChristian S.: B- durch C#-Tags ersetzt
Moderiert von user profile iconChristian S.: Topic aus C# - Die Sprache verschoben am Sa 23.02.2008 um 16:05
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Sa 23.02.08 18:33 
Das sollte genau das sein, was du suchst. :)
Levsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Mo 25.02.08 17:28 
das will net ganz funtzen wenn ich das rausnehme

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
        //     No dialog box confirming the deletion of the objects will be displayed.
        const int SHERB_NOCONFIRMATION = 0x00000001;
        //     No dialog box indicating the progress will be displayed.
        const int SHERB_NOPROGRESSUI = 0x00000002;
        //     No sound will be played when the operation is complete.
        const int SHERB_NOSOUND = 0x00000004;


Was muss ich daran ändern damit das ohne Progressbar und so gezeigt wird ???

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
    public class ShellBin
    {
        [DllImport("shell32.dll")]
        static extern int SHEmptyRecycleBin(IntPtr hWnd, string pszRootPath, uint dwFlags);

        //     No dialog box confirming the deletion of the objects will be displayed.
        const int SHERB_NOCONFIRMATION = 0x00000001;
        //     No dialog box indicating the progress will be displayed.
        const int SHERB_NOPROGRESSUI = 0x00000002;
        //     No sound will be played when the operation is complete.
        const int SHERB_NOSOUND = 0x00000004;

        public static void EmptyRecycleBin()
        {
            BinUtils.EmptyRecycleBin ( string.Empty );
        }

        public static void EmptyRecycleBin( string rootPath )
        {
            int hresult = SHEmptyRecycleBin(IntPtr.Zero, rootPath,
                    SHERB_NOCONFIRMATION | SHERB_NOPROGRESSUI | SHERB_NOSOUND);
            System.Diagnostics.Debug.Write(hresult);
        }
    }
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Mo 25.02.08 22:18 
user profile iconLevsen hat folgendes geschrieben:
das will net ganz funtzen wenn ich das rausnehme
Was meinst du damit :gruebel: ? So sollte der Code aber eigentlich stimmen, was passiert denn bis jetzt?
Levsen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16



BeitragVerfasst: Di 26.02.08 16:49 
ich bekomme ne fehlermeldung.
Visual C# 2008 sagt mir das irgendwas mit der Progressbar is das die net da ist, wenn ich denn teil der progressbar dann rausnehme bekomme ich keine fehlermeldung aber nichts passiert beim klicken
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Di 26.02.08 18:18 
Fehler werden seltenst dadurch gelöst, dass man einfach Code entfernt :P . Du solltest wohl lieber (ggf. mit unserer Hilfe) versuchen, den Fehler zu korrigieren.