Foxtable(狐表)用户栏目专家坐堂 → VB.NET如何转狐表?


  共有671人关注过本帖树形打印复制链接

主题:VB.NET如何转狐表?

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


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 14:59:00 [只看该作者]

'Imports System
'Imports System.Collections.Generic
'Imports System.ComponentModel
'Imports System.Data
'Imports System.Drawing
'Imports System.Linq
'Imports System.Text
'Imports System.Windows.Forms
'Imports System.Diagnostics

Namespace lxw_mysql_helper
    Public Partial Class frmMain
        Inherits Form
报错未定义Form
        Public Sub New()
            InitializeComponent()
        End Sub

    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As EventArgs)
            System.Text.txtName.Enabled = False
'            txtPwd.Enabled = False
报错不是System.Text.txtName.、 txtPwd不是Text成员

        Public Shared Sub RunCMD(ByVal workingDirectory As String, ByVal command As String)
            Dim p As Process = New Process()

报错模块中不能Shared 

 Dim command As String = sbcommand.ToString()
                ShowLog("命令:" & command)
                RunCMD(appDirecroty, command)
                ShowLog("路径:" & directory)

报错RunCMD(appDirecroty, command),RunCMD保护不能访问

    Private Sub btnSelectMysqlPath_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim path As FolderBrowserDialog = New FolderBrowserDialog()

            If Not String.IsNullOrEmpty(txtMysqlPath.Text) Then
                path.SelectedPath = txtMysqlPath.Text
            End If

报错txtMysqlPath保护不能访问

    Private Sub ShowLog(ByVal log As String)
            rtxtShow.AppendText(log & vbCrLf)
        End Sub
报错rtxtShow保护不能访问

  Private Sub btnEdit_Click(ByVal sender As Object, ByVal e As EventArgs)
            If btnEdit.Text = "修改" Then
                txtName.Enabled = True
报错btnEdit.保护不能访问

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106097 积分:539590 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/3/9 15:10:00 [只看该作者]

转换后的完整代码发上来

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:50:00 [只看该作者]

狐表官方报错

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:52:00 [只看该作者]





 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:53:00 [只看该作者]

上传不了。老报服务器500

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:53:00 [只看该作者]

'Imports System.ComponentModel
'Imports System.Data
'Imports System.Drawing
'Imports System.Linq
'Imports System.Text
'Imports System.Windows.Forms
'Imports System.Diagnostics

Namespace lxw_mysql_helper
    Public Partial Class frmMain
        Inherits Form

        Public Sub New()
            InitializeComponent()
        End Sub

        Public bakpath As String = "D:\db_ba\"

        Public backupTime As String = "00:30"


        Private Sub frmMain_Load(ByVal sender As Object, ByVal e As EventArgs)
            System.Text.txtName.Enabled = False
'            txtPwd.Enabled = False
'            txtport.Enabled = False

        End Sub

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:54:00 [只看该作者]

 Public Shared Sub RunCMD(ByVal workingDirectory As String, ByVal command As String)
            Dim p As Process = New Process()
            p.StartInfo.FileName = "cmd.exe"
            p.StartInfo.WorkingDirectory = workingDirectory
            p.StartInfo.UseShellExecute = False
            p.StartInfo.RedirectStandardInput = True
            p.StartInfo.RedirectStandardOutput = True
            p.StartInfo.RedirectStandardError = True
            p.StartInfo.CreateNoWindow = True
            p.Start()
            p.StandardInput.WriteLine(command)
            p.StandardInput.WriteLine("exit")
        End Sub

       

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  18楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:55:00 [只看该作者]

 Public Sub bakup_db(ByVal Optional manual As String = "")
            Try
                Dim sbcommand As StringBuilder = New StringBuilder()
                Dim sbfileName As StringBuilder = New StringBuilder()

          
                Dim fileName As String = sbfileName.ToString()

                If False = System.IO.Directory.Exists(bakpath) Then
                    System.IO.Directory.CreateDirectory(bakpath)
                End If

                Dim directory As String = bakpath & fileName & ".bak"

                If System.IO.File.Exists(directory) = True Then
                    Return
                End If

                sbcommand.AppendFormat("uname, upass, dbname, directory, port)
                Dim command As String = sbcommand.ToString()
                ShowLog("命令:" & command)
                RunCMD(appDirecroty, command)
                ShowLog("路径:" & directory)
            Catch ex As Exception
                ShowErrorLog("失败:" & ex.Message)
            End Try
        End Sub


 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 15:59:00 [只看该作者]

    Private Sub btnBackUp_Click(ByVal sender As Object, ByVal e As EventArgs)
            bakup_db("manual")
        End Sub

        Private Sub btnSelec-tMysqlPath_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim path As FolderBrowserDialog = New FolderBrowserDialog()

            If Not String.IsNullOrEmpty(txtMysqlPath.Text) Then
                path.Selec-tedPath = txtMysqlPath.Text
            End If

            path.ShowDialog()
            txtMysqlPath.Text = path.Selec-tedPath
        End Sub


       

 回到顶部
帅哥哟,离线,有人找我吗?
lin98
  20楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1060 积分:7009 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2024/3/9 16:00:00 [只看该作者]

 Private Sub ShowLog(ByVal log As String)
            rtxtShow.AppendText(log & vbCrLf)
        End Sub

        Private Sub ShowErrorLog(ByVal log As String)
            rtxtShow.Selec-tionStart = rtxtShow.Text.Length
            rtxtShow.Selec-tionLength = log.Length
            rtxtShow.Selec-tionColor = Color.FromName("Red")
            rtxtShow.AppendText(log & vbCrLf)
        End Sub

 回到顶部
总数 23 上一页 1 2 3 下一页