//字符模式下预览的方法 private void charsModePreview() { CharsMode mydict = new CharsMode(chkbLsmall.Checked, chkbLbig.Checked, chkbNumber.Checked, chkbHyphen.Checked, txtbSelf.Text, Int32.Parse(cbbStart.Text), Int32.Parse(cbbEnd.Text)); txtbStrNum.Text = mydict.dictRows().ToString(); txtbFileSize.Text = mydict.fileSize(); }
//字符模式下"生成"的方法 private void charsModeMake() { CharsMode mydict = new CharsMode(chkbLsmall.Checked, chkbLbig.Checked, chkbNumber.Checked, chkbHyphen.Checked, txtbSelf.Text, Int32.Parse(cbbStart.Text), Int32.Parse(cbbEnd.Text)); if (isFirstClick == true) { if (mydict.dictRows() > 100000) //如果生成量过大,则进行提示 { charsModePreview(); MessageBox.Show("字典文件较大,生成耗时,请在预览区查看体积,如需生成,再次点击“生成”"); isFirstClick = false; return; } else { mydict.writeFile(); string tmpPath = ucDstPath.Text; File.Copy(@"c:\result.txt", tmpPath, true); lblMsg.Visible = true; } } else { mydict.writeFile(); string tmpPath = ucDstPath.Text; File.Copy(@"c:\result.txt", tmpPath, true); lblMsg.Visible = true; isFirstClick = true; } }