Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:小狐 帖子:341 积分:3406 威望:0 精华:0 注册:2013/5/17 10:55:00
  发帖心情 Post By:2016/12/19 16:15:00 [显示全部帖子]

1.生成加密的配置文件

Dim iport As String = e.Form.Controls("TxtIP").text & ":" & e.Form.Controls("Txtport").text & ":" & e.Form.Controls("Txtinterval").text & ":" & e.Form.Controls("Txttimeout").text

Dim contxt1 As String = e.Form.Controls("TextBox2").text

Dim contxt2 As String = e.Form.Controls("TextBox1").text

FileSys.WriteAllText( projectpath & "/config/config" & Format(Date.now,"yyyyMMdd") & ".txt",EncryptText(iport & vbcrlf & contxt1 & vbcrlf & contxt2,"****","****"), False)

2.读取配置文件

BeforeConnectOuterDataSource

 

'''

If e.name = "rsgl" Then

    Dim CnString As String

    If filesys.FileExists(ApplicationPath & "config.txt")

        Dim contxt() As String = DecryptText(filesys.ReadAllText(ApplicationPath & "config.txt"),"*****","*****").split(vbcrlf)

        If contxt.Length > 1 Then

            CnString = contxt(1)

        Else

            MessageBox.show("系统配置文件错误,请联系管理员。","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning)

            Syscmd.Project.Exit()

            Return

        End If

        If Connections.TryConnect(CnString) = True Then

            e.ConnectionString = CnString

        Else

            messagebox.show("无法连接到数据库,请联系管理员。","警告",MessageBoxButtons.OK,MessageBoxIcon.Warning)

            Syscmd.Project.Exit()

            Return

        End If

    Else

        messagebox.show("没有找到系统配置文件,无法连接到数据,请联系管理员。","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)

        Syscmd.Project.Exit()

        Return

    End If

End If


 回到顶部