c# 导入文本控件

2023-09-22 00:30:48 阅读 0评论
 using System.IO;

TextBox txt = new TextBox();
            OpenFileDialog odf = new OpenFileDialog();
            if(odf.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                string file = odf.FileName;
                
                txt.Text = File.ReadAllText(file, Encoding.Default);
                
            }
免责声明:本站所有资源均由网络搜集用户投稿而来,若有侵权,违法违规侵权内容请联系本站并提供必要证明,本站将及时删除违法违规内容,谢谢合作!