freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

visualc2008大學(xué)教程第十九章-資料下載頁

2025-05-10 20:02本頁面
  

【正文】 r file nor directory exists ( + does not exist, File Error, , )。 } // end else } // end if } // end method inputTextBox_KeyDown // 獲取文件或目錄信息 ,并輸出到 outputTextBox private void GetInformation ( string fileName ) { ( )。 // output that file or directory exists ( fileName + exists\n )。 例子 演示 File與 Directory類 (續(xù) 3) C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 74 // output when file or directory was created ( Created: + ( fileName ) + \n )。 // output when file or directory was last modified ( Last modified: + ( fileName ) + \n )。 // output when file or directory was last accessed ( Last accessed: + ( fileName ) + \n )。 } // end method GetInformation } // end class FileTestForm } // end namespace FileTest 例子 演示 File與 Directory類 (續(xù) 4) C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 75 例子 程序運(yùn)行結(jié)果 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 76 例子 程序運(yùn)行結(jié)果(續(xù)) C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 77 例子 用 LINQ查找目錄 類 LINQToFileDirectoryForm用 LINQ和 File、Path與 Directory類報(bào)告指定目錄路徑中每類文件的個(gè)數(shù)。下面的程序就演示這種功能,還可以找出當(dāng)前目錄下的所有擴(kuò)展名為 .bak的備份文件,顯示一個(gè)消息框,詢問用戶是否將其刪除,然后根據(jù)用戶的輸入選擇做出刪除這些文件還是置之不理的決定。 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 78 例子 用 LINQ查找目錄 // Fig : : Using LINQ to search // dires and determine file types. using System。 using 。 using 。 using 。 using 。 namespace LINQToFileDirectory { public partial class LINQToFileDirectoryForm : Form { string currentDirectory。 // directory to search // store extensions found, and number of each extension found Dictionarystring, int found = new Dictionarystring, int ( )。 // parameterless constructor public LINQToFileDirectoryForm ( ) { InitializeComponent ( )。 } // end constructor C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 79 例子 用 LINQ查找目錄(續(xù) 1) // handles the Search Directory Button39。s Click event private void searchButton_Click ( object sender, EventArgs e ) { // check if user specified path exists if ( != amp。amp。 ! ( ) ) { // show error if user does not specify valid directory ( Invalid Directory, Error, , )。 } // end if else { // use current directory if no directory is specified if ( == ) currentDirectory = ( )。 else currentDirectory = 。 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 80 例子 用 LINQ查找目錄(續(xù) 2) // search directory using LINQ private void SearchDirectory ( string folder ) { // files contained in the directory string[ ] files = ( folder )。 // subdirectories in the directory string[ ] directories = ( folder )。 // find all file extensions in this directory var extensions = ( from file in files select ( file ) ).Distinct ( )。 // count the number of files using each extension foreach ( var extension in extensions ) { var temp = extension。 // count the number of files with the extension var extensionCount = ( from file in files where ( file ) == temp select file ). Count ( )。 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 81 // if the Dictionary already contains a key for the extension if ( ( extension ) ) found[ extension ] += extensionCount。 // update the count else ( extension, extensionCount )。 // add new count } // end foreach foreach ( var subdirectory in directories ) // recursive call to search subdir SearchDirectory( subdirectory )。 } // end method SearchDirectory private void CleanDirectory( string folder ) // allow user to delete backup { // files contained in the directory string[] files = ( folder )。 // subdirectories in the directory string[] directories = ( folder )。 // select all the backup files in this directory var backupFiles = from file in files where ( file ) == .bak select file。 例子 用 LINQ查找目錄(續(xù) 3) C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 82 foreach ( var backup in backupFiles ) // iterate over all backup files { DialogResult result = ( Found backup file + ( backup ) + . Delete?, Delete Backup, , )。 if ( result == ) // delete file if user clicked 39。yes39。 { ( backup )。 // delete backup file found[ .bak ]。 // decrement count in Dictionary // if there are no .bak files, delete key from Dictionary if ( found[ .bak ] == 0 ) ( .bak )。 } // end if } // end foreach // recursive call to clean subdirectories foreach ( var subdirectory in directories ) CleanDirectory( subdirectory )。 } // end method CleanDirectory } // end class LINQToFileDirectoryForm } // end namespace LINQToFileDirectory 例子 在字符串中搜索字符和子串(續(xù) 4) C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 83 例子 用 LINQ查找目錄運(yùn)行結(jié)果 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 84 C把文件視為一種無結(jié)構(gòu)的連續(xù)字符流或數(shù)據(jù)流。數(shù)據(jù)流提供了一種向后備存儲(chǔ)器寫入字節(jié)信息和從后備存儲(chǔ)器讀取字節(jié)信息的方式,它是在 .NET Framework中執(zhí)行讀寫文件操作時(shí)一種非常重要的介質(zhì)。 數(shù)據(jù)流 C語言程序設(shè)計(jì) 理工大學(xué)華信軟件學(xué)院 張一鳴 85 .NET Framework使用流來執(zhí)行讀取和寫入文件操作,開
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1