我有这个VB代码:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim phpref As String = ""
For Each foundFile As String In My.Computer.FileSystem.GetFiles("c:\windows\system32\drivers")
Dim sFileName As String = (foundFile)
Dim Info As FileVersionInfo
Info = FileVersionInfo.GetVersionInfo(sFileName)
phpref &= Info.FileDescription & "-"
phpref &= Info.FileVersion & "|"
Next
Dim userip As String = GetIPAddress()
End Sub
Private Function GetIPAddress() As String
Dim strHostName As String
Dim strIPAddress As String
strHostName = System.Net.Dns.GetHostName()
strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()
Return strIPAddress
End Function
End Class
我想将变量userip
和变量phpref
插入到我网站的mysql
数据库中。
答案 0 :(得分:0)
这个问题太广泛了,无法回答,但这里有一些参考链接可以帮助您入门:
mySQL的连接字符串
http://www.connectionstrings.com/providers/mysql-connector-net-mysqlconnection
有关如何使用ADO.NET使用VB.NET连接mySQL的视频
http://www.youtube.com/watch?v=u3hRvoUpetQ
试试这些,然后如果你遇到困难,请在这里提出一个更具体的问题