.NET客户端应用程序服务生产设置

时间:2023-01-29 15:49:19

I am creating a desktop/client application that will be installed on +/- 5 PCs, that will be transacting with a database on a central server machine. This app requires login authentication which I've in past rolled my own (messy, but it worked). Then I thought it would be great to leverage ASP.NET Membership,Roles,Profile...etc..

我正在创建一个将安装在+/- 5台PC上的桌面/客户端应用程序,它将与*服务器计算机上的数据库进行交易。这个应用程序需要登录身份验证,我已经过去了我自己(凌乱,但它工作)。然后我认为利用ASP.NET Membership,Roles,Profile ...等会很棒。

After some reading up I came across the .NET Client Application Services which suits my purposes. However I have a few concerns that I am hoping some of you out there can answer:

经过一些阅读后,我遇到了适合我目的的.NET客户端应用服务。但是我有一些担忧,我希望你们中的一些人可以回答:

  • When creating the Application Services Host, the article I've linked to above mentions that in development I should create an ASP.NET Web Service Application. Will this be the same for production? I ask this as this article suggests that I should be using a proper ASP.NET website. But then that begs the question as to whether I should'nt use a normal ASP.NET website with membership, roles, profiles in development to begin with, and then copy across to production?
  • 在创建应用程序服务主机时,我上面链接的文章提到在开发中我应该创建一个ASP.NET Web服务应用程序。这对生产来说是一样的吗?我问这个,因为这篇文章建议我应该使用一个合适的ASP.NET网站。但接下来的问题是,我是否应该使用正常的ASP.NET网站,其中包含开发中的成员资格,角色,配置文件,然后复制到生产中?

  • In my Winfroms app, will I still be able to leverage functionality like: "if (!User.IsAuthenticated)" and so forth?
  • 在我的Winfroms应用程序中,我是否仍然可以利用以下功能:“if(!User.IsAuthenticated)”等等?

  • If the Name of the central server in the office that the web service app or website resides is say: "MYOFFICE_SERVER", what will the production URL be for client machines to connect to?
  • 如果Web服务应用程序或网站所在的办公室*服务器的名称是:“MYOFFICE_SERVER”,那么客户端计算机要连接的生产URL是什么?

  • I have also seen this article. Can this be construed as an alternative, or is the Client Application Services the preferred way to go?
  • 我也看过这篇文章。这可以解释为替代方案,还是客户端应用服务是首选方式?

  • Finally, are there any other production-specific settings that I should be aware of?
  • 最后,我应该注意哪些其他特定于生产的设置?

I'm sorry. I realise that these are probably very juvenile questions to ask, but I would sincerely appreciate your help as Im heavily confused!!

对不起。我意识到这些可能是非常少年的问题,但我真诚地感谢你的帮助,因为我很困惑!

Thank you.

1 个解决方案

#1


  1. You can use "ASP.NET Web Service Application" or "ASP.NET Website" as long as they expose the services that you need (membership, roles, profiles).
  2. 您可以使用“ASP.NET Web服务应用程序”或“ASP.NET网站”,只要它们公开您需要的服务(成员资格,角色,配置文件)。

  3. Indeed, in your client you will be able to do things like:

    实际上,在您的客户中,您将能够执行以下操作:

    bool log = Membership.ValidateUser("username", "password"); //hard code login bool log = Membership.ValidateUser(null, null); //use a login form if (Thread.CurrentPrincipal.IsInRole("Principal"))... //check if the user is a member of a role Settings.Default.lowValue //use properties from the profile

    bool log = Membership.ValidateUser(“username”,“password”); //硬编码登录bool log = Membership.ValidateUser(null,null); //使用登录表单if(Thread.CurrentPrincipal.IsInRole(“Principal”))... //检查用户是否是角色的成员Settings.Default.lowValue //使用配置文件中的属性

  4. the url is usually the url of the website with authentication (or the subdirectory in that url if you use a Web Service).

    url通常是具有身份验证的网站的URL(如果您使用Web服务,则为该URL中的子目录)。

  5. For production.. first make sure that the form authentication works (when using a browser). And then try using it from the window client.

    对于生产..首先确保表单身份验证有效(使用浏览器时)。然后尝试从窗口客户端使用它。

Watch these 2 videos (in fact, one uses "ASP.NET Web Service Application" and the other an "ASP.NET Website"):

观看这两个视频(事实上,一个使用“ASP.NET Web服务应用程序”,另一个使用“ASP.NET网站”):

#1


  1. You can use "ASP.NET Web Service Application" or "ASP.NET Website" as long as they expose the services that you need (membership, roles, profiles).
  2. 您可以使用“ASP.NET Web服务应用程序”或“ASP.NET网站”,只要它们公开您需要的服务(成员资格,角色,配置文件)。

  3. Indeed, in your client you will be able to do things like:

    实际上,在您的客户中,您将能够执行以下操作:

    bool log = Membership.ValidateUser("username", "password"); //hard code login bool log = Membership.ValidateUser(null, null); //use a login form if (Thread.CurrentPrincipal.IsInRole("Principal"))... //check if the user is a member of a role Settings.Default.lowValue //use properties from the profile

    bool log = Membership.ValidateUser(“username”,“password”); //硬编码登录bool log = Membership.ValidateUser(null,null); //使用登录表单if(Thread.CurrentPrincipal.IsInRole(“Principal”))... //检查用户是否是角色的成员Settings.Default.lowValue //使用配置文件中的属性

  4. the url is usually the url of the website with authentication (or the subdirectory in that url if you use a Web Service).

    url通常是具有身份验证的网站的URL(如果您使用Web服务,则为该URL中的子目录)。

  5. For production.. first make sure that the form authentication works (when using a browser). And then try using it from the window client.

    对于生产..首先确保表单身份验证有效(使用浏览器时)。然后尝试从窗口客户端使用它。

Watch these 2 videos (in fact, one uses "ASP.NET Web Service Application" and the other an "ASP.NET Website"):

观看这两个视频(事实上,一个使用“ASP.NET Web服务应用程序”,另一个使用“ASP.NET网站”):