【IT168技术文档】
示例在Form中有一个 Richtextbox
应用程序入口处:this.richTextBox1.Location = new System.Drawing.Point(21, 28); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(233, 168); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = "";
继承 Forms 的类static void Main(String []args) { String filePath = null; if (args.Length != 0) { filePath = args[0]; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1(filePath)); }
结束。public partial class Form1 : Form { String fp = null; public Form1(String filePath) { fp = filePath; InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { if (fp != null) { richTextBox1.LoadFile(fp, RichTextBoxStreamType.PlainText); } } }
一直在努力,致力于计算机局域网研究和工具开发