private void txt_total_TextChanged(object sender, EventArgs e) { txt_koushui.Text = txt_total.Text; INIClass ini_class = new INIClass("D:\\yinuo.ini"); ini_class.IniWriteValue("JiXiangCaiJi", "ZongShuiE", txt_koushui.Text); }
public XiaoXiangCaiji() { InitializeComponent(); INIClass ini_class = new INIClass("D:\\yinuo.ini"); string shuier = ini_class.IniReadValue("KaiPiao", "ShuiEr"); _txt_shuie.Text = shuier; _btn_jine.Text = ini_class.IniReadValue("KaiPiao", "HeJi"); //(Double.Parse(shuier) / 0.17).ToString("f2"); _txt_total_jiner.Text = _btn_jine.Text; _txt_total_shuier.Text = _txt_shuie.Text; ini_class.IniWriteValue("XiaoXiangCaiJi", "ZongShuiE", _btn_jine.Text); }
public void ShowExcel() { INIClass ini_class = new INIClass("D:\\yinuo.ini"); Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); excel.Application.DisplayAlerts = false;//不显示提示对话框 Microsoft.Office.Interop.Excel.Workbook xBook = excel.Workbooks._Open(shenbaobiao_path, Missing.Value, Missing.Value, Missing.Value, Missing.Value , Missing.Value, Missing.Value, Missing.Value, Missing.Value , Missing.Value, Missing.Value, Missing.Value, Missing.Value); string G8 = ini_class.IniReadValue("JiXiangCaiJi", "ZongShuiE"); if (G8 != "") { Microsoft.Office.Interop.Excel.Worksheet xSheet = (Microsoft.Office.Interop.Excel.Worksheet)xBook.Sheets["附表二"]; Microsoft.Office.Interop.Excel.Range rng = xSheet.get_Range("G8", Missing.Value); rng.Value2 = G8; } string E8 = ini_class.IniReadValue("XiaoXiangCaiJi", "ZongShuiE"); if (E8 != "") { Microsoft.Office.Interop.Excel.Worksheet xSheet = (Microsoft.Office.Interop.Excel.Worksheet)xBook.Sheets["附表一"]; Microsoft.Office.Interop.Excel.Range rng = xSheet.get_Range("E8", Missing.Value); rng.Value2 = E8; } ////保存方式三 xBook.Save(); excel.Visible = true; //xSheet = null; //xBook = null; //excel.Quit();//Excel從內在中退出 //excel = null; }