通过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
最满意答案
您提供的第一个链接是您需要的良好开端。
- 存储所有图像以进行产品更改....
它显示了如何上传多个文件。 通过此操作,您可以修改插入图像的表格,以便将记录关系的密钥添加回产品。
- 检索产品更改的所有图像...
要从数据库中取回它们,您可以调用同一篇文章中的代码(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...)
相关问答
更多-
看看我上传图像的文章 ,或者你可以使用下面描述的相同的代码; 你的视图代码; @using (Html.BeginForm("FileUpload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) {默认情况下,数据库不支持数组,哈希等。 为了做到这一点,您可以序列化它将此代码添加到您的模型: class Name_class < ActiveRecord::Base serialize :column_name, JSON end 并更改迁移字段: add_column :user_preferences, :text 这会将信息作为Text插入到数据库中,当您检索它时,它将是JSON 。 有关serialization更多信息,请访问RailsGuides#Serialize I am no ...
Codeigniter:通过Ajax上传图像并存储在db中(Codeigniter: Uploading image through Ajax and storing in db)[2019-12-10]
您不能使用$("input#pfile").val();发送文件数据$("input#pfile").val(); var len = $("#pfile").files.length; var file = new Array(); var formdata = new FormData(); for(i=0;i多个图片上传问题(Multiple images uploading issue)[2023-10-21]
您正在尝试使用数组$ _FILES ['multiple_uploaded_files'] ['name']连接字符串。 对于Array to string转换错误 替换代码 $fileName = $_FILES['multiple_uploaded_files']['name']; 同 $fileName = $file; (or) $fileName = $_FILES['multiple_uploaded_files']['name'][0]; 单个文件上传问题。 您尚未在jav ...您可能需要更改您的PHP设置以允许更大的上传。 PHP对文件上传大小,POST大小等有限制 转到: /etc/php5/fpm/php.ini或/etc/php/7.0/fpm/php.ini或者如果您使用Apache /etc/php/7.0/apache2/php.ini并更改这些值。 post_max_size = 125M upload_max_filesize = 100M max_file_uploads = 20 以更高的价值。 其中post_max_size是整个POST的最大大小 ...Django上传多张图片(Django uploading multiple images)[2022-07-15]
您需要创建一个看起来像这样的独立模型 class ExamFile(models.Model): file = models.ImageField() exam = models.ForeignKey(Exam, null=False) 然后在您看来,不是将exam_file添加到考试中,而是使用它来创建这个新模型。 这看起来像这样 from .models import Exam, ExamFile ... exam_file = ExamFile.objects.create( ...错误不必眩目代码。 代码执行时引发的错误。 并且必须注意和调查这些错误。 至少将这两行添加到您的代码中并再次运行它。 ini_set('display_errors',1); error_reporting(E_ALL); 或者以任何其他方式获取move_uploaded_file生成的错误消息。 试图在没有实际错误消息的情况下回答您的问题将是无用的浪费时间。 Errors don't have to glare in the code. Errors being raised at the time t ...您将空字符串传递给INT ID。 没有那个我会试试。 代替: mysql_query("INSERT INTO 'blob' VALUES('','$imageName','$imageData')"); 尝试: mysql_query("INSERT INTO blob (name, image) VALUES('$imageName','$imageData')"); You're passing an empty string to the INT id. I would try it witho ...您提供的第一个链接是您需要的良好开端。 存储所有图像以进行产品更改.... 它显示了如何上传多个文件。 通过此操作,您可以修改插入图像的表格,以便将记录关系的密钥添加回产品。 检索产品更改的所有图像... 要从数据库中取回它们,您可以调用同一篇文章中的代码(GetFile),修改select语句以包含单个图像ID的产品密钥INSTEAD。 显示产品更改的所有图像... 这是它变化很大的地方。 第一篇文章的作者仍然将一个文件作为FileContentResult返回。 显然,这对你的情况不起作用。 看看这篇文 ...上传图片 - 安全(Uploading Images - Security)[2022-10-24]
将图像放在App_Data文件夹中时会收到403响应,因为IIS会阻止任何浏览器直接访问App_Data中的文件。 将它们放在〜/ Images /中,但取决于该文件夹的安全性,这可能意味着任何人都可以列出〜/ Images /和/或查看图像的内容。 默认情况下,IIS禁止列出任何文件夹的内容,但允许任何人查看图像。 因此,如果有人知道图像的文件名,他们就可以查看它们。 解决方案是使用基于URL的身份验证 。 只有导师(或任何需要的人)才能看到图像。 如果您想完全控制谁在哪些页面上看到了什么,您仍然可以将图 ...相关文章
更多- Chapter 9 - Securing Your Application -- Professional ASP.NET MVC 1.0
- Full-Text Search in ASP.NET using Lucene.NET
- AMF: ASP.NET Mobile Framework
- 微信公众平台开发小记(ASP.NET)
- asp.net 列表控件
- asp.net mvc 微信开发随笔(1)
- 微信公众平台开发(ASP.NET)
- How to Start a Business in 10 Days
- Ubuntu(Linux) + mono + jexus +asp.net MVC3 部署
- 微信.NET 微信开发 自动内容回复 ASP.NET C#代码
最新问答
更多- 获取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的基本操作命令。。。