Advertisement
Advertisement
| 01.27.2008 at 08:07AM PST, ID: 23114648 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 01.28.2008 at 03:20AM PST, ID: 20758173 |
| 01.28.2008 at 03:33AM PST, ID: 20758215 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: |
public void StartSite(string serverID)
{
try
{
string serverName = "W3SVC/" + serverID;
ManagementObject webSite = new ManagementObject(_scope, new ManagementPath(@"IIsWebServer='" + serverName + "'"), null);
App.StdOut("Starting..." + webSite.Path);
// Check if the website is stopped or paused
if ((int)webSite["ServerState"] == 4 || (int)webSite["ServerState"] == 6)
{
webSite.InvokeMethod("Start", null);
}
}
catch (Exception ex)
{
App.LogException(ex);
}
}
public void DeleteExistingSites()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher(_scope, new ObjectQuery("SELECT * FROM IIsWebServer"), null);
ManagementObjectCollection webSites = searcher.Get();
foreach (ManagementObject webSite in webSites)
{
App.StdOut("Deleting... " + webSite.Path);
webSite.Delete();
}
}
catch (Exception ex)
{
App.LogException(ex);
}
}
public void SetAspNetVersion(string frameworkVersion, string IISWeb)
{
string frameworkDirectory;
string directory;
System.Collections.ArrayList al;
//Execute the following command in the correct .net framework version directory.
//Aspnet_regiis.exe -s W3SVC/1/ROOT/SampleApp1
if (frameworkVersion != "v1.1.4322")
{
al = new System.Collections.ArrayList();
directory = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory();
int dirPos = directory.Remove(directory.Length - 1, 1).LastIndexOf(@"\");
frameworkDirectory = directory.Remove(dirPos, directory.Length - dirPos);
frameworkDirectory = frameworkDirectory + @"\" + frameworkVersion + @"\";
if (!Directory.Exists(frameworkDirectory))
{
throw new Exception("Cannot find framework. Check correct framework is installed");
}
Process process = new Process();
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.FileName = frameworkDirectory + "aspnet_regiis";
process.StartInfo.Arguments = @"-sn " + String.Format(@"W3SVC/{0}",IISWeb);
process.Start();
process.WaitForExit();
}
}
|
| 01.30.2008 at 09:10AM PST, ID: 20778799 |