The icon for getting the file is that I used the class of someone else and still don't understand me at the learning stage:
Create folder
String wnapt = combbb. Text + "\" + "new folder ";
Int I = 0;
String newpath = wnapt;
While (directory. exists (newpath ))
{
Newpath = wnapt + I. tostring ();
I ++;
}
Directory. createdirectory (newpath );
CC (New directoryinfo (combbb. Text. tostring ()));
Also, copy, paste, and cut are simple. I will not write the source code ··
There is also a feature of some diaries, which is actually very simple. There are still many bugs that haven't been written yet ··
It is to write the text to the class and save it as a file ··
// Save the text to the class. Save the Class Writer file.
Private void savetoolstripmenuitem_click (Object sender, eventargs E)
{
String name = application. startuppath + @ "\ ntobook" + "\" + "riji ";
Int I = 0;
String nname = Name;
While (file. exists (nname ))
{
Nname = Name + I. tostring ();
I ++;
}
Wang W = new Wang (textbox1.text );
Filestream FS = new filestream (nname, filemode. Create, fileaccess. Write );
Binaryformatter BF = new binaryformatter ();
BF. serialize (FS, W );
FS. Close ();
Notbook ();
}
[Serializable]
Public class Wang
{
Public Wang (string txt)
{
This. txt = txt;
}
String txt;
Public String txt
{
Get {return txt ;}
Set {TXT = value ;}
}
}
The most interesting thing is renaming. I have read many methods on the Internet, such as using file. Move ··
I use cmd, haha ·
Private void rename toolstripmenuitem_click (Object sender, eventargs E)
{
Listview1.labeledit = true;
Listview1.selecteditems [0]. beginedit (); // You can edit it when you click rename.
}
Private void listviewappsafterlabeledit (Object sender, labelediteventargs E)
{// In this event
// After editing .. Run cmd to get the name.
Process. start ("cmd", "/C" + "Ren" + listview1.selecteditems [0]. tag. tostring () + "" + E. label. tostring () + "");
}
I learned C # the code I wrote was not long ago. Sorry ······
Source program download