一共470多例winform 界面特效的源码
主要程序代码。将打开文件路径写入INI文件的实现代码如下: private void 打开ToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog1.FileName = ""; this.openFileDialog1.ShowDialog(); StreamWriter s = new StreamWriter(address "\\Menu.ini", true); s.WriteLine(openFileDialog1.FileName);//写入INI文件 s.Flush(); s.Close(); ShowWindows(openFileDialog1.FileName); }读取INI文件并将信息加入菜单的实现代码如下: private void Form1_Load(object sender, EventArgs e) { StreamReader sr = new StreamReader(address "\\Menu.ini"); int i = this.文件ToolStripMenuItem.DropDownItems.Count-2; while (sr.Peek()>=0)//读取INI文件 { ToolStripMenuItem menuitem = new ToolStripMenuItem(sr.ReadLine()); this.文件ToolStripMenuItem.DropDownItems.Insert(i, menuitem); i ; menuitem.Click = new EventHandler(menuitem_Click); } sr.Close();
评论