如何使用C#使我的系统可访问或无法访问 [英] How Can I Make My System As Accessible Or Inaccessible Using C#

查看:116
本文介绍了如何使用C#使我的系统可访问或无法访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hai all,



我将使用c#在窗口应用程序中创建一个项目...其中我想创建登录应用程序来存储用户用户登录系统时数据库中的信息..



我已创建登录表单并在启动时添加。但用户无需登录即可访问系统形成。那么如何让用户在登录windoow表单后访问系统。请给我一个非常紧急的...

hai all,

I'm going to create one project in window application using c#...In which i want to create login application to store the user information in database when the user login to the system..

I had create login form and add it on startup .But the user can access the system without login into the form. so how can i make the user to access the system after login into the windoow form. please anser me its very urgent...

推荐答案

>如何在登录windoow表单后让用户访问系统。

在显示应用程序主表单之前显示登录表单。 如果登录失败,只需退出该应用程序。 否则,继续显示主表格。



>请给我一个非常紧急的...

CodeProject会员自愿花时间去帮助别人。您的紧迫感不过是志愿者参与自己工作的紧迫性。所以请多给我们这个小小的信息。



/ ravi
> how can i make the user to access the system after login into the windoow form.
Display the Login form before the application's main form is displayed.  If the login fails, simply exit the application.  Otherwise, continue with displaying the main form.

> please anser me its very urgent...
CodeProject members volunteer their time to help others. Your urgency is no more than than the urgency of volunteers to attend to their own work. So please spare us this little nugget of information.

/ravi


我不知道其他人,但是我编写的系统有登录的用户,我有登录过程返回一个令牌(GUID),必须在后续API调用中提供。如果没有正确的令牌,所有请求都将被拒绝。这也意味着用户一次只能登录一次(而不是从多个位置登录)。如果你愿意,你甚至可以在一段时间后将令牌超时。



I don't know about anyone else, but for the systems I have written that have users who "log in", I have the login process return a Token (GUID) that must be provided on subsequent calls to the API. Without the proper Token, all requests are rejected. This also means that a user can be logged in only once at a time (not from multiple locations). You can even have the Token time out after some period if you like.

Guid token = api.Login ( username , hashedpassword ) 

DataTable dt = api.GetSomeData ( Token , yada yada yada ... )


这篇关于如何使用C#使我的系统可访问或无法访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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