miraclemaker
Programmer
I've written a script that gets a piece of information from one of the Windows performance counters. I've set it up in a virtual directory and created a web.config file. This works just fine.
I've written a second script, as below and compiled it using csc.exe to allow me to run the first script from the command line.
This compiles fine. I put it in the same directory as my first script and try and run it - before it will run it makes me copy the exe I just compiled and the first script into a directory called 'bin', which I do. Now when I try and run it I just get an access denied error. Can anyone help?
I've written a second script, as below and compiled it using csc.exe to allow me to run the first script from the command line.
Code:
using System;
using System.IO;
using System.Web;
using System.Web.Hosting;
public class MyExeHost : MarshalByRefObject {
public void ProcessRequest(String page) {
HttpRuntime.ProcessRequest(new SimpleWorkerRequest(page, null, Console.Out));
}
public static void Main(String[] arguments) {
MyExeHost host = (MyExeHost)ApplicationHost.CreateApplicationHost(typeof(MyExeHost), "/asp_dot_net_code", Directory.GetCurrentDirectory());
foreach (String page in arguments) {
host.ProcessRequest(page);
}
}
}
This compiles fine. I put it in the same directory as my first script and try and run it - before it will run it makes me copy the exe I just compiled and the first script into a directory called 'bin', which I do. Now when I try and run it I just get an access denied error. Can anyone help?