iis-6

How to shutdown machine from ASP.NET

岁酱吖の 提交于 2019-12-05 11:54:59
I have a machine running Windows Home Server v1 (WHS is based on Windows Server 2003 and is runningh IIS6) and on here I have a restful webservice running which I build in C# VS2008 (dotnet 3.5). From within the webservice I want to be able to; 1 Check that certain windows services are running; 2 Start certain windows services 3 Stop certain windows services 4 Reboot the machine 5 Shutdown the machine For 1-3 then I am using impersonation to elevate the ASPNET user to the local administrator (it is only me running this on a local secure network) and then "ServiceController" to control the

NULL reference exception while reading user sessions (Reflection)

好久不见. 提交于 2019-12-05 09:17:23
I have implemented the code for reading the active sessions using the reference Reading All Users Session and Get a list of all active sessions in ASP.NET . Private List<String> getOnlineUsers() { List<String> activeSessions = new List<String>(); object obj = typeof(HttpRuntime).GetProperty("CacheInternal", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null); object[] obj2 = (object[])obj.GetType().GetField("_caches", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(obj); for (int i = 0; i < obj2.Length; i++) { Hashtable c2 = (Hashtable)obj2[i].GetType().GetField("

How to deploy WCF service on IIS 6.0

a 夏天 提交于 2019-12-05 08:04:24
I have IIS 6.0 on Windows Server 2003. I installed .NET 3.5 and 4 beta 2. "Normal" ASP things are working (perfect). But when I try to navigate to my service ( /myServer/MyService.svc ) I get a 404. Page not found. To be exact, I got a 404 2 "Web service extension lockdown policy prevents this request." I used ServiceModelReg.exe /ia to make sure that the extension I known and I checked the configuration using: admin-Tools, iis, home-tab, configuration, executable-box, and there: Extension: .svc, path: c:\windows\microsoft.net\framework\v4.0.210... , verbs: all verbs. So everything seems OK.

SqlClient calls causing “Thread was being aborted at SNINativeMethodWrapper.SNIPacketGetConnection(IntPtr packet)”

心已入冬 提交于 2019-12-05 07:56:18
I would really appreciate any suggestions, no matter how simple or complex, to help me get this issue isolated and resolved. I have a bit of code that generates small report files. For each file in the collection, a stored proc is executed to get the data via XML reader (its a pretty big result set). When I created all this, and stepped through it, all is well. Files are generated, no errors. This library is called via remoting, and is hosted via IIS. When I deploy the compiled library and call it, its able to generate some of the reports, but then throws a Thread Abort Exception. If I attach

Impersonation and Delegation

对着背影说爱祢 提交于 2019-12-05 07:52:51
问题 I am using impersonation is used to access file on UNC share as below. var ctx = ((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate(); string level = WindowsIdentity.GetCurrent().ImpersonationLevel); On two Windows 2003 servers using IIS6, I am getting different impersonation levels: Delegation on one server and Impersonation on the other server. This causes issues where I am unable to access the UNC share on the server with 'Impersonation' level. What could be causing this

Getting error 400 / 404 - HttpUtility.UrlEncode not encoding full string?

匆匆过客 提交于 2019-12-04 21:31:20
问题 Why do the following URLs give me the IIS errors below: A) http://192.168.1.96/cms/View.aspx/Show/Small+test' A2) http://192.168.1.96/cms/View.aspx/Show/Small%20test' <-- this works, but is not the result from HttpUtility.UrlEncode() B) http://192.168.1.96/cms/View.aspx/Show/'%26$%23funky**!!~''+page Error for A: HTTP Error 404.11 - Not Found The request filtering module is configured to deny a request that contains a double escape sequence. Error for B: HTTP Error 400.0 - Bad Request ASP.NET

Windows Integrated Authentication Conflict With MS-SQL 2000 DB Connection With Integrated Security

青春壹個敷衍的年華 提交于 2019-12-04 21:14:08
We are developing an intranet web application on .NET 2.0 platform. The application is using Integrated Windows Authentication for Single Sign On. The users are authorized to use diffent modules according to the Active Directory Groups they are in. Up to the point where authentication and authorization is accomplished everything works fine. But the problem starts when application tries to connect to the database on MSSQL Server. According to the security policies of our customer, no database user or password data should be kept in connection strings or in registry even if encrypted. So we are

Making an asp.net application IPv6 compliant

无人久伴 提交于 2019-12-04 20:15:21
问题 We have Windows 2003 Servers running SQL Server 2005 and .NET 3.5 [separately]. We have a basic ASP.NET app running on IIS 6. What, if anything, do I need to do on the application end [IIS,Framework,ASP.NET] to make it IPv6 compatible? EDIT: We do use System.DirectoryServices, System.DirectoryServices.DirectoryEntry and DirectorySearcher() to authenticate users against AD. Would those calls have to change? 回答1: The first thing to do would be search your code for any references to System.Net

Security exception when writting to an EventLog from an ASP.NET MVC application

南楼画角 提交于 2019-12-04 19:26:59
问题 I have a library that I created with some business logic that includes writing to a System.Diagnostics.EventLog instance. The library is normally called from a Windows Service application, but now I'm trying to call those same library functions from my ASP.NET MVC application. I tried this code inside my controller to create the EventLog instance that I pass into the method that needs to write to the log. Dim log = New EventLog("Application", My.Computer.Name, "MyMVCApp") The following error

Limiting number of calls to an ASMX Web Service

…衆ロ難τιáo~ 提交于 2019-12-04 19:06:19
We have an asmx web service hosted in IIS6. Is there a good way to limit the number of calls to the service in a period of time for a single IP? We don't want to put a hard limit (X number of times an hour), but we want to be able to prevent a spike from a single user. We're currently investigating to see if our firewall is capable of limiting connection attempts. In the case that our firewall is not able to limit connections, is there a good way to handle this programmatically? Rather than trying to come up with our own custom solution and reinventing the wheel, is there an existing