Reference
Using shell32;
Private void open_click (Object sender, routedeventargs e) {openfiledialog ofd = new openfiledialog (); ofd. filter = "MP3 files(folder) | *. MP3 | WMA files (*. WMA) | *. WMA "; // ofd. multiselect = true; // multiple ofd options are allowed. restoredirectory = true; // remember the last file path ofd. showdialog (); filepath = ofd. filename; If (filepath! = "") {String openfiletype = path. getextension (filepath); fileinfo filelenght = new fileinfo (filepath); If (filelenght. length & gt; 10240000) {funcclass. showerror ("too large! ");} Else {shellclass SH = new shellclass (); folder dir = Sh. namespace (path. getdirectoryname (filepath); folderitem item = dir. parsename (path. getfilename (filepath); string newpath = path. getdirectoryname (filepath) + "\" + dir. getdetailsof (item, 20) + "-" + dir. getdetailsof (item, 21) + openfiletype; If (! File. exists (newpath) {file. move (filepath, newpath); // rename is actually move} dir = Sh. namespace (path. getdirectoryname (newpath); item = dir. parsename (path. getfilename (newpath); pathfile. TEXT = newpath; filename. TEXT = path. getfilenamewithoutextension (newpath) + openfiletype; musicname. TEXT = dir. getdetailsof (item, 21); writewords. TEXT = ""; writemusic. TEXT = ""; singer. TEXT = dir. getdetailsof (item, 13); album. TEXT = dir. getdetailsof (item, 14); time. TEXT = dir. getdetailsof (item, 27 );}}}
Explanation: Example: Jay Chou-Qinghua Porcelain
-1 project type: MP3 file
Size: 3.62
Artist: Jay Chou
Length: 00: 03: 57
0: blue/white porcelain enamel (file name)
1: 3.62 MB (size)
2: MP3 files (project type)
3: XXXX-XX: XX (modification time)
9: audio (file type)
10: Administrators (user name)
11: Music)
13: Jay Chou (singing)
14: one name Song (album)
15: 2002 (year)
19: not graded
20: Jay Chou (singing)
21: blue/White Porcelain (song name)
27: 00:03:57
28: 128 Kbps
29: No
After modification, Jay Chou-Qinghua Porcelain
Legend:
After opening, the corrected song information is displayed:
Private void upload () {// wenserver needs to define WebClient = new WebClient (); byte [] responsearray = WebClient. uploadfile ("http: // 192.168.1.11/webform1.aspx", "Post", @ "" + filepath + ""); // HTTP path string getpath = encoding. getencoding ("UTF-8 "). getstring (responsearray); funcclass. showinformation ("song already" + getpath + "upload to server"); // return information}