Saturday, December 26, 2009

Folder creation and deletion, POPUp Window C#

Folder can be created in C# by
Directory.CreateDirectory("C:\TmpFolder");

This line will create TmpFolder in C drive.

Folder can be deleted in a same way by
Directory.DeleteDirectory("C:\TmpFolder");

This line will delete TmpFolder from C drive.

Folders can be retrieve from a specific location
Directory.GetDirectories, it returns in a string array format.

Logical drives can be retrived by the method
Environment.GetLogicalDrives, it returns all the logical drives in a string array format.

Environment.username returns the name of the user who logged in the application.

POPUp Window
___________

PopUp window is nothing, it is just the movement of height & set the location in the starting of a form.

You just need to know screen resolution by Screen.PrimaryScreen.
set the width and height of the form and its size. drop a timer and on the interval event decrease the height of the popupWindow...

Don't forget to mention ShowInTaskbar = false, ControlBox=false on form level...

An small application is created that create and delete folder and shows a pop-up window on the folder creation and deletion event.

You can download code from here

No comments:

Post a Comment