从winforms应用程序调用位于服务器上的函数? [英] Call a function that is located on server from a winforms app?

查看:59
本文介绍了从winforms应用程序调用位于服务器上的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WEB编程的新手,特别是数据库的东西。

我已经成功地将我的WinForm应用程序转换为ASP.Net程序,我可以从浏览器访问它。现在我想创建一个类似于我之前的WinForm应用程序,但它应该从数据库或服务器读取函数的结果。 (不知道)



我想要实现的是,由于安全原因,我有一些不应该在我的WinForm应用程序中的功能,所以没有人反汇编程序。我将调用接受用户名和密码参数的函数,并在成功验证时返回结果。



这是否可行。我可以在root或DataBase上实现一个文件,它可以处理来自客户端的函数调用而无需下载整个文件并对其进行反序列化吗?我知道DataBases可以包含可以调用的静态数据但是它们是否可以处理逻辑?



我对VB.Net很熟悉,已经在ASP中做了一些很好的步骤。净。 HTML和JavaScript似乎不像以前想的那么难学。



所有帮助表示赞赏



我尝试过:



---------------------- -----------------------

Hi, i am new to WEB programming especially to Database stuff.
I have converted my WinForm App to ASP.Net program succesfully and i can access it from browser. Now i want to create a WinForm App similar to my previous, but which should read the results of Functions from a Database or Server. (have no idea)

What i want to achieve is that i have some functions that should not be within my WinForm app for the reason of security so noone disassemles the program. I shall call the Function that accepts parameters of username and password and returns the result on succesful authentication.

Is this possible at all. Can i implement a file on root or maybe on DataBase that can handle calls to a Function from a client without downloading the whole file and deserializing it? I know that DataBases can contain static data that can be called but whether they can handle logic?

I am familiar to VB.Net, have made some good steps into ASP.Net. HTML and JavaScript seem to be not hard to learn as thought before.

All help is appreciated

What I have tried:

---------------------------------------------

推荐答案

答案是肯定的。

有两种方法:

1)存储过程。数据库可以包含代码 - 称为存储过程 - 访问表并可以返回数据。问题是数据库本身必须可以由外部世界直接访问,这是一个安全漏洞。

2)尝试查看WCF:获取入门教程 [ ^ ] - 它允许您定义在您的服务器上运行并与您的客户端一起运行的服务通信。当客户端请求时,服务访问您的数据库,执行所需的逻辑并返回数据。因为数据库永远不会直接暴露,并且服务代码不可用,所以它非常安全。
The answer is yes.
There are two ways:
1) Stored procedures. Databases can contain code - called stored procedures - which access the tables and can return the data. The problem is that the database itself must be directly accessible by the outside world, which is a security hole all on it's own.
2) Try looking at WCF: Getting Started Tutorial[^] - it allows you to define a service which runs on your server and with which your client communicates. The service access your DB when the client requests it, performs the logic it needs and returns the data. Because the database is never exposed directly, and the service code is not available, it is nicely secure.


这篇关于从winforms应用程序调用位于服务器上的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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