asp.net网站托管在c#(安全) [英] asp.net web site hosted in c# (Securely)

查看:68
本文介绍了asp.net网站托管在c#(安全)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我正在寻找一种在c#中托管asp.net网络应用程序/网站的方法。



完成这项任务的方法是什么?



[INFO]

我有ac#应用程序。

在应用程序文件中会有一个文件夹,其中会存储网站文件。

我需要这个应用程序作为Web服务器。

我已经能够使用自定义http命令托管Web服务器,例如:http:// localhost:8081 / DO / ieplore.exe(应用程序将打开Internet Explorer)

我也可以在我的应用程序中的指定文件夹中服务html页面。



[文件夹的原因]

实际页面代码隐藏,无法访问和篡改。



[NOW]

我需要能够在内置有活动代码的asp.net页面中执行此操作。



我如何才能完成任务这个?



谢谢。

Hello

I am looking for a way to host a asp.net web application / site in c#.

What is the way I would go about accomplishing such a task?

[INFO]
I have a c# application.
In the applications files there would be a folder in which the websites files would be stored.
I need this application to serve as a web server.
I have been able to host a web server with custom http commands, eg: http://localhost:8081/DO/ieplore.exe (and the application would open Internet explorer)
I have also been able to server html pages from within a specified folder in my application.

[REASON FOR FOLDER]
Actual page code is hidden from access and tampering.

[NOW]
I need to be able to do this with asp.net pages with active code inside.

How would I go about accomplishing this?

Thanks.

推荐答案

你好,Mitchell,



[不完全确定你的问题是什么,但你可以调整\ expand,我会在答案中添加更具体的信息]



在您的网页中添加代码没有问题。

如果您谈论的服务器端代码可以是 C# 因为它似乎是您的首选,但如果您查看客户端代码,那么我建议您使用 Javascript



如果您希望服务器端代码能够执行诸如运行特定 exe 文件之类的任务,请根据您的示例注意您将需要提升本地服务器计算机上的网站权限。



如果您需要有关用于承载ASP.NET站点的首选应用程序的建议,那么当然是 IIS



你可以使用NTFS permi ssions阻止对所选用户以外的所有文件夹的访问(本地),或者如果你想使用LDAP(例如,活动目录用户和权限)



这样,有权访问该计算机的其他用户将无法访问该文件夹,您的网页可以访问该文件IIS默认用户或您可以实现模拟(如果您需要链接解释如何),请使用您选择的用户访问该文件夹。





干杯,

Edo
Hello, Mitchell,

[Not entirely sure what your question exactly, but you can adjust\explain and I will add info to the answer to be more specific]

There is no problem adding code in your web pages.
If you are talking about server-side-code that can be C# as it seems your preferable choice, but if you looking into client-side-code then I''d suggest you use Javascript.

If you want the server side code to be able to perform tasks such as running a specific exe file, as per your example then note that you will need to boost permissions of the website on the local server machine.

If you need an advice on the preferred application that is used to host ASP.NET sites then that is of course IIS.

You can use NTFS permissions to block all access to the folder other than your selected users (locally) or the same idea if you want to use LDAP (e.g. active directory users and permissions)

This way other users that have access to the computer will not be able to access the folder, your web page can access the files either with the IIS default user or you can implement impersonation (let me know if you need links explaining "how to") to access with the folder with the user of your choice.


Cheers,
Edo


便携式网络服务器是什么意思?

你打算开发一个类似exe的web服务器,它将在没有安装的情况下运行(即没有IIS或其他解决方案)?
What do you mean by "portable web server"?
you plan on developing an exe-like web-server that will be run with no installation (i.e. without IIS or some other solution)?


这篇关于asp.net网站托管在c#(安全)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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