从VB.NET应用程序连接到网站数据库 [英] Connect to a website database from VB.NET app

查看:91
本文介绍了从VB.NET应用程序连接到网站数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我希望我的桌面应用程序可以连接到网站数据库(使用MySQL数据库).

我会使用网站URL,例如 http://www.codeproject.com 作为主机吗?

请帮忙.

在此先感谢.

Hello guys,

I want my desktop application to connect in Website database (MySQL Database is used).

Will I use the website URL, e.g., http://www.codeproject.com as my host?

Please help.

Thanks in advance.

推荐答案

在VB中尝试此代码..
TRY this CODE in VB ..
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Navigate("http://login.website.co/")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        WebBrowser1.Document.GetElementById("login").SetAttribute("value", TextBox1.Text)
        WebBrowser1.Document.GetElementById("passwd").SetAttribute("value", TextBox2.Text)

        WebBrowser1.Document.GetElementById(".save").InvokeMember("click")
    End Sub

End Class



(从网站注册并从适用于在线游戏的程序登录.)
(或者,您可以在程序中放入一个小的Web浏览器,然后单击登录",它就会加载并登录到您的网站.)

对于代码中的登录"和密码" 6-7行,您需要使用Internet Explorer,Mozzila,Opera等网络浏览器来编辑网站的HTML代码,并查看它们是否相同,如果不是,只需复制并替换为代码即可.

如果您还有其他问题,请通过Cassanovazzz@live.com或facebook.com/Bo00oDy与我联系.



(Register from the website and login from the program suitable for online gaming.)
(Or you can put a small webbrowser inside your program and just when you click "Login", it will load and log into your website.)

For the "Login" and "passwd" 6-7 line in the code, you need to edit the HTML code of the website by using a webbrowser like Internet Explorer, Mozzila, Opera, etc. and see if they are the same or not, if not just copy and replace them in the code.

If you have more problems, just contact me on Cassanovazzz@live.com or facebook.com/Bo00oDy.


网站数据库的含义是什么..,

您的意思是数据库位于具有公共IP的另一台服务器上.如果可以,请使用该公共IP更改主机地址.
what do you mean by website database..,

You mean that database is located in another server, that have a public IP., if yes change the host address with that public IP.


没有网站数据库"之类的东西. "

假设您真正的意思是我如何连接到提供数据的Web服务",唯一可能的答案是咨询提供数据的公司的文档和/或服务台".与Web服务的连接和通信取决于接口协定的编写方式.没有一个适合所有人的答案.就编写Web服务而言,这是一个非常复杂的过程,没有简单的答案.您可以在Code Project上引用几个示例,以及大量的教科书和其他资源.
There is no such thing as a "website database."

Assuming you really mean "How do I connect to a web service that provides data," the only possible answer is "Consult with the documentation and/or help desk of the company that is providing the data." Connecting and communicating with a web service depends on how the interface contracts are written; there is no one-size-fits-all answer. As far as writing a web service, that is a very complicated process with no simple answer. There are several examples here at Code Project that you can reference, and plenty of text books and other resources.


这篇关于从VB.NET应用程序连接到网站数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆