TAILIEUCHUNG - C Sharp part 13

mình mởi đầu một cái ví dụ lấy nội dung một file! PHP Code: using System; using ; using ; /* * Created by SharpDevelop. * NetDevelop Co., Ltd. * Author: Tuan Anh Nguyen Ngoc * Date: 11/21/2006 * | minh mai dau mot cai vi du lay noi dung mot file PHP Code using System using using System. Text Created by SharpDevelop. NetDevelop Co. Ltd. Author Tuan Anh Nguyen Ngoc Date 11 21 2006 Contact Information. - Email email email - Handheld 84 905 202 088 namespace public class File summary define string fullpath. summary private string _sFullPath summary Contraction of this class. summary public File summary Contraction of this class. summary param name _pfullpath The string fullpath. param public File string _pfullpath set fullpath. _pfullpath summary Get Set fullpath string of file. summary public string FullPath return fullpath. get return set fullpath. set value summary Get file content. summary returns return file content as string. returns private string FileContent define string result. string _sResult check file path. throw exception if is null or empty. if null throw exception. throw new Exception Can not get content The file is not define or declare. else check file exists throw exception if it isn t exist. if System .. Exists this. FullPath Create filestream with filemode open and fileaccess read. FileStream _oFileStream new FileStream Fi Create byte array. Byte _oByte new byte 1024 Create UTF8Encoding. UTF8Encoding _oUTF8Encoding new UTF8Encoding while filestream read byte 0. while _oByte 0 0 _sResult _oByte else throw exception. throw new Exception Can not get content The file can not be found. return result. return _sResult summary Ill Get file content. orverload fileContent method. Ill lsummary Ill param name _pfullpath The fullpath string. lparam lll returns return file content as string. lreturns public string FileContent string _pfullpath lllset fullpath. _pfullpath lllcall fileContent method return .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.