首页 \ 问答 \ 通过ASP.NET启动服务需要什么权限?(What permissions are needed to start a service through ASP.NET?)

通过ASP.NET启动服务需要什么权限?(What permissions are needed to start a service through ASP.NET?)

我想知道让用户在我们的服务器上启动服务需要什么特权。

情况如下,我们网站上的一些人可以在服务器上启动某项服务(Windows 2008和IIS7)。 到目前为止我的工作方式是指定我使用我的用户帐户创建的应用程序池(msdn的模拟方法由于某种原因不起作用)。 然而,现在我想将该用户帐户更改为仅具有启动和停止服务的权限的用户帐户(以及让他执行此操作所需的一切)。

该网站是用ASP.NET和C#编写的。 我使用ServiceController来启动和停止我的服务。

我应该为该用户分配哪些权限?

编辑:我只想在这里澄清一些事情。 我设法让这个东西通过应用程序池工作(虽然它不能通过调试器工作) 。 但它只适用于属于Administrators组的用户,这不是我想要的。 我想指定一个只能通过网站启动和停止服务的特殊用户。 那么我需要什么特权? 请具体说明。

编辑2:我发现为什么我的服务不会在调试器中启动。 我没有运行具有管理员权限的Visual Studio。 我现在感觉很蠢..无论如何,问题仍然存在,因为我仍然需要具有正确权限的特殊用户。

任何评论将不胜感激! 亲切的问候,Floris Devriendt


I was wondering what privileges I needed to let a user start a service on our server.

The situation is as follows, some people on our website can start a certain service on the server (Windows 2008 and IIS7). The way that worked so far with me was specifying the application pool I created with my user account (the impersonate method from msdn doens't work for some reason). Now however I want to change that user account to a user account who only has the priviliges to start and stop a service (and everything that is needed to get him to do that).

The website is written in ASP.NET and C#. I use the ServiceController to start and stop my services.

Which privileges should I assign to that user?

EDIT: I just want to clear some things up here. I managed to get this thing working through the Application pool (although it doesn't work through debugger). But it only works with a user that is part of the Administrators group which isn't what I want. I want to specify a special user that will only be able to start and stop the service through the website. So what privileges do I need? Please be specific.

EDIT 2: I found out why my service wouldn't start in the debugger. I didn't run Visual Studio with administrator rights. I feel so stupid right now.. Anyway the question still stands as I still need my special user with the correct permissions.

Any comment will be appreciated! Kind regards, Floris Devriendt


原文:https://stackoverflow.com/questions/6184564
更新时间:2022-07-21 07:07

最满意答案

您提供的第一个链接是您需要的良好开端。

  • 存储所有图像以进行产品更改....

它显示了如何上传多个文件。 通过此操作,您可以修改插入图像的表格,以便将记录关系的密钥添加回产品。

  • 检索产品更改的所有图像...

要从数据库中取回它们,您可以调用同一篇文章中的代码(GetFile),修改select语句以包含单个图像ID的产品密钥INSTEAD。

  • 显示产品更改的所有图像...

这是它变化很大的地方。 第一篇文章的作者仍然将一个文件作为FileContentResult返回。 显然,这对你的情况不起作用。

看看这篇文章。 它使用XML文件加载多个图像,但是您将使用GetFiles中的代码替换此代码以创建图像列表。 它显示了如何为此创建控制器,模型和视图。 您可以创建局部视图,使图像与产品视图位于同一页面上。

此示例显示如何将数据库中的图像列表放入视图中。 (帮助修改GetFiles以更好地为此工作......)


The first link you provided is a good start for what you need.

  • Store all images for a product change....

It shows how to upload multiple files. From this you could modify the table where the images are inserted to add a key for the record relation back to your product.

  • Retrieve all images for a product change...

To pull them back from the database you would call the code in the same article (GetFile), modifying the select statement to include your product key INSTEAD of the ID of the individual image.

  • Display all images for a product change...

This is where it changes quite a bit. The author of the first article still returns one file as a FileContentResult. Obviously, this won't work for your situation.

Have a look at this article. It uses an XML file to load up multiple images BUT you would replace this code with the code in GetFiles to create the Image List. It shows how to create a controller, model and view for this. You could create a partial view to have the images on the same page as the product view.

This sample shows how to get an image list out of the DB into a view. (To help with modifying GetFiles to better work for this...)

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。