|
I am trying to iisreset a remote machine programtcailly.I used the following code:
CODE I:
ServiceController controller = new ServiceController();
controller.machineName = "<remote machine="" name="">";
controller.serviceName= "IISADMIN";
if (controllet.Status ==ServiceCOntrollerStatus.Running)
{
Controller.Stop();
Controller.Start();
}
The probelm with Code I is it stops the service but does not start it.
CODE II:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.Process.Start("cmd.exe", "iisreset remotemachine");
procee.close();
The issue with CODE II is that the current code is executed from a sql server where iis service does not exist. So the command executes without any error but does not do anything.
How can I resolve this issue.
Hema
|
|
|
|
|
Member 3449442 wrote: How can I resolve this issue.
Well if you want our help you might consider posting code that compiles. The reason for this is that it makes your statement seem like a lie:
Member 3449442 wrote: I used the following code:
Member 3449442 wrote: The probelm with Code I is it stops the service but does not start it.
led mike
|
|
|
|
|
Try this
ServiceController controllerIISADMIN = new ServiceController();
controllerIISADMIN.ServiceName = "IISADMIN";
ServiceController controllerW3SVC = new ServiceController();
controllerW3SVC.ServiceName = "W3SVC";
if (controllerW3SVC.Status == ServiceControllerStatus.Running)
{
controllerIISADMIN.Stop();
controllerIISADMIN.Refresh();
System.TimeSpan timeout = TimeSpan.FromSeconds(60000);
controllerIISADMIN.WaitForStatus(ServiceControllerStatus.Stopped, timeout);
if (controllerIISADMIN.Status == ServiceControllerStatus.Stopped)
{
controllerW3SVC.Start();
controllerW3SVC.Refresh();
controllerIISADMIN.Refresh();
}
}
Also make sure IIS Console is not open when you run the above code.
|
|
|
|
|
Hi,
please i need to read an Image from sql server and Display it in Image control.
Note that this is a single Image control.
Mohammad Al Hoss
|
|
|
|
|
If you want to show more than the image, you need a HTTP Handler, which takes the Id of the image on the URL and spits back the image bytes. There have to be articles on CP about this.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I was trying to copy something from the windows assembly to my desired location.
I have done this before and it worked fine. For example, I've done this:
c:\windows\assembly\gac_msil\ xcopy microsoft.reportviewer.processingObjectModel c:\temp /i /h /s /r /y
Now, Im trying to use this:
c:\windows\assembly\ xcopy CrystalDecisions.ReportAppServer.ClientDoc c:\temp /i /h /s /r /y
And it says 'c:\windows\assembly\' is not recognized as an internal or external....bla bla bla
Anybody knows whats wrong with this?
Thanks.
Ekjon
|
|
|
|
|
Ekjon wrote: Anybody knows whats wrong with this?
I know nothing about this but looking at your post I see:
Ekjon wrote: c:\windows\assembly\gac_msil\ xcopy microsoft.reportviewer.processingObjectModel c:\temp /i /h /s /r /y
Ekjon wrote: c:\windows\assembly\ xcopy CrystalDecisions.ReportAppServer.ClientDoc c:\temp /i /h /s /r /y
led mike
|
|
|
|
|
If it works for "c:\windows\assembly\gac_msil\", then it should work for
"c:\windows\assembly\" as well - isn't it?
But thanks for ur attempt.
EKjon
|
|
|
|
|
Ekjon wrote: If it works for "c:\windows\assembly\gac_msil\", then it should work for
"c:\windows\assembly\" as well - isn't it?
hehe that's a rhetorical question yes?
led mike
|
|
|
|
|
In the past I used an add-in that gave me an open opposite (c++ .h <--> .cpp) feature.
Does something similar exist for asp.net (.aspx <--> aspx.cs or .asmx <--> .asmx.cs)?
Todd Smith
|
|
|
|
|
Todd Smith wrote: Does something similar exist for asp.net (.aspx <--> aspx.cs or .asmx <--> .asmx.cs)?
Yes. Menu items "View Code" and "View Designer" in VS2005
led mike
|
|
|
|
|
I was hoping to bind a key to toggle between them. I guess I'll have to write a macro.
Todd Smith
|
|
|
|
|
Todd Smith wrote: I guess I'll have to write a macro.
Why, is there something wrong with F7 and Shift F7?
led mike
|
|
|
|
|
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
In web form two dropdown box. second dropdown box values are loaeded depends on the selection change of first dropdown box. values are loaded from database. page used AJAX updatepanel control. the above exception is thrown. how to over come this problem.
thanks in advance!
Have A Nice Day!
Murali.M
Blog
|
|
|
|
|
Thats quite a general error you have posted, can you post your code so we can see what is happening
|
|
|
|
|
Dear all,
I am using asp.net 2.0 , C#
I want to use application block for data accessing. I download DataAccessApplicationBlock msi and install the same but I want to know I can I use application block in my project. Please help .
THANK YOU
regards
imran khan
|
|
|
|
|
when I download files like doc file etc. then downloading is working fine
but when .txt file then it's opening this file in browser only not coming dialog box for downloading.
same problem in image downloading also.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Can you be more specfic, where are you downloading them from?
|
|
|
|
|
downloading from application(server hard disc) to client(user)'s machine.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
The reason for this is down to MIME types. Your browser recognises a MIME of image/jpg as one it caan display.
If you want to force the browser to download it you can append a MIME type of application/octet-stream
Response.ContentType = "application/octet-stream";
|
|
|
|
|
Hello,
I am not sure but I think it is possible to LOCK or FREEZING every thing while you are running .aspx application. For example when that application is running so you can't open an other IE, you can't use calculator, you can't klick startup button and you can't use any shortcut og microsoft windows.
When you have been stopped the application then you can use Windows normally... It is possible????
If yes! plese write few codes or examples.
modified on Wednesday, May 21, 2008 10:00 AM
|
|
|
|
|
this is potentially a dangerous thing to do, as you are trying to control the windows operating system through your own code, is it possible to do your task another way?
whats the reason for locking the operating system?
|
|
|
|
|
perhaps you are trying to run the .aspx app and it's hitting an infinite loop somewhere and taking up all your resources.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
I think he wants to lock all other applications whilst his is running, i dont think it is happening already by accident.
|
|
|
|
|
oh im a tard
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|