|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?加入会员
x
Button1.Text = "文件生成中..." Me.Cursor = Cursors.WaitCursor Dim fPath As String = "" Dim frmOut As New SaveFileDialog Dim txtTemp As String Dim arr(100) As String Dim X As Integer X = Len(txtNum.Text) - Len(GetFirstNum(txtNum.Text)) txtTemp = Mid(txtNum.Text, 1, X) frmOut.Title = "输出到TXT..." frmOut.Filter = "txt文件(*.txt)|*.txt" If frmOut.ShowDialog() = Windows.Forms.DialogResult.OK Then fPath = frmOut.FileName Me.Cursor = Cursors.WaitCursor Dim stW As IO.StreamWriter, FS As IO.FileStream FS = New IO.FileStream(fPath, IO.FileMode.Create) stW = New IO.StreamWriter(FS) For i As Integer = 1 To CInt(Trim(txtCount.Text)) Dim astr As String() Dim pp As String Dim YY As String pp = Tospace(txtNum.Text) astr = pp.Split("+") YY = CStr(CInt(astr(1)) + i) If (CInt(YY) < 10 ^ Len(astr(0))) = True Then YY = CStr(CInt(astr(0)) + i) Else YY = Mid(CStr(10 ^ Len(astr(0))), 2) 'astr(1) = CInt(astr(1)) + 1 End If stW.WriteLine(txtTemp & YY) Next MessageBox.Show("输出成功!") Button1.Text = "生成完毕" txtNum.Text = "" txtCount.Text = "" stW.Close() Me.Cursor = Cursors.Default End If Me.Cursor = Cursors.Default |
|