Dim dlg As new SaveFileDialog dlg.Filter = "文本|*.txt" If dlg.ShowDialog = DialogResult.OK Then Dim fm As String = "id={0} state={1} comment={2} cl_name= ip_addr={3} mac={4} " Dim t As Table = Tables("表A") Dim str As String = "" For Each r As Row In t.Rows If str > "" Then str = str & vbcrlf & cexp(fm, r("编号"), r("状态"), r("备注"), r("ip"), r("mac")) Else str =cexp(fm, r("编号"), r("状态"), r("备注"), r("ip"), r("mac")) End If Next msgbox(str) FileSys.WriteAllText(dlg.FileName, str, False, encoding.default) End If
|