国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

文件流

2019-11-17 03:11:43
字體:
來源:轉載
供稿:網友

文件流

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;

namespace 文件流 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }

        PRivate void btnOpen1_Click(object sender, EventArgs e)         {             OpenFileDialog readOFD = new OpenFileDialog();             if (readOFD.ShowDialog() == DialogResult.OK)             {                 txtPath1.Text = readOFD.FileName;             }         }

        private void btnRead_Click(object sender, EventArgs e)         {             using (FileStream fs = new FileStream(txtPath1.Text, FileMode.Open))             {                 byte[] bytearry=new byte[1024*1024*4];                int length= fs.Read(bytearry,0,bytearry.Length);                if (length > 0)                {                    txtinputbox1.Text = Encoding.UTF8.GetString(bytearry);                }             }            

        }

        private void btnOpen2_Click(object sender, EventArgs e)         {             OpenFileDialog writOpneFileDialog = new OpenFileDialog();             if (writOpneFileDialog.ShowDialog() == DialogResult.OK)             {                 txtPath2.Text = writOpneFileDialog.FileName;             }         }

        private void btnWrite_Click(object sender, EventArgs e)         {             using (FileStream fs = new FileStream(txtPath2.Text, FileMode.Create))             {                 byte[] bytefile=Encoding.UTF8.GetBytes(textBox3.Text.Trim());                 fs.Write(bytefile,0,bytefile.Length);             }         }     } }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 石渠县| 海伦市| 仪陇县| 武汉市| 珲春市| 青河县| 阜平县| 延川县| 博罗县| 安丘市| 崇信县| 武乡县| 建瓯市| 商城县| 信宜市| 永顺县| 龙川县| 海兴县| 柞水县| 崇州市| 安义县| 峨山| 成都市| 嘉定区| 宜黄县| 林西县| 汝阳县| 宜良县| 长阳| 牙克石市| 巴彦淖尔市| 黄骅市| 平武县| 得荣县| 吴忠市| 马鞍山市| 内丘县| 科技| 泰州市| 炉霍县| 吐鲁番市|