Foxtable(狐表)用户栏目专家坐堂 → txt文件增加内容


  共有2375人关注过本帖平板打印复制链接

主题:txt文件增加内容

帅哥哟,离线,有人找我吗?
huhu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1165 积分:8129 威望:0 精华:0 注册:2015/3/30 10:44:00
txt文件增加内容  发帖心情 Post By:2020/8/27 11:16:00 [只看该作者]

现在生成的txt内容是
env_00230248773.dat    sn: 00230248773    mac: 9845.62fa.4a20    
env_00230248774.dat    sn: 00230248774    mac: 9845.62fa.4a30    
env_00230248775.dat    sn: 00230248775    mac: 9845.62fa.4a40    
希望能做成下面内容,相比原txt增加了key和ssid。key是随机生成的8位都是小写,ssid是有DDTV-和mac地址后6位组成,都是大写。
env_00230248773.dat    sn: 00230248773    mac: 9845.62fa.4a20    key: wueyeq5x    ssid: DTTV-FA4A20
env_00230248774.dat    sn: 00230248774    mac: 9845.62fa.4a30    key: r7fywazv      ssid: DTTV-FA4A30
env_00230248775.dat    sn: 00230248775    mac: 9845.62fa.4a40    key: d72ea9m3    ssid: DTTV-FA4A40

click代码:
Dim startSN As WinForm.TextBox = e.Form.Controls("TextBox11")
Dim xqsl As WinForm.TextBox = e.Form.Controls("TextBox22")
Dim endsn As WinForm.TextBox = e.Form.Controls("TextBox55")
Dim epromlj As WinForm.TextBox = e.Form.Controls("TextBox88")
Dim txtlj As WinForm.TextBox = e.Form.Controls("TextBox01")

Dim id11 As Integer = CInt(startSN.text)
Dim id22 As Integer = CInt(xqsl.text)
Dim id33 As Integer = id11 + id22 - 1
Endsn.text = id33

Dim inilj As WinForm.TextBox = e.Form.Controls("TextBox44")
Dim iniwj As WinForm.TextBox = e.Form.Controls("TextBox33")
Dim pfid As Integer = Inilj.text .IndexOf(":")
Dim pfwj As String = Inilj.text.Substring(0,pfid + 1)
Dim id As Integer = inilj.text.lastindexof("\")
Dim lj As String = inilj.text.Substring(0,id) & "\"
Dim p As new Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False '关闭Shell的使用
p.StartInfo.RedirectStandardInput = True '重定向标准输入
p.StartInfo.RedirectStandardOutput = True '重定向标准输出
p.StartInfo.RedirectStandardError = True '重定向错误输出
p.StartInfo.CreateNoWindow = False '设置不显示窗口
p.Start()
p.StandardInput.WriteLine(pfwj)
p.StandardInput.WriteLine("cd" & " " & lj)
p.StandardInput.WriteLine(e.Form.Controls("TextBox7").text & " " & e.Form.Controls("TextBox11").Text & " " & e.Form.Controls("TextBox22").Text & " " & e.Form.Controls("TextBox33").Text, 1)
p.StandardInput.WriteLine("exit")
Dim id3 As Integer = Iniwj.text.IndexOf(".")
Dim Iniwjlj As String = Iniwj.text.SubString(0,id3)
Dim txtstr As String = Iniwjlj & "(" & e.Form.Controls("TextBox11").text & "-" & e.Form.Controls("TextBox55").text & ")" & ".txt"
txtlj.text = lj & txtstr         'txtljtxt这个文件怎么处理才能实现这个需求呢?
epromlj.text = lj
MessageBox.show("INI文件:" & e.Form.Controls("TextBox33").Text & vbcrlf & "需求数量:" & e.Form.Controls("TextBox22").Text & vbcrlf & "生成目录:" & lj,"eprom生成完成",MessageBoxButtons.OK,MessageBoxIcon.Information )

 回到顶部