Click here to Skip to main content
15,888,297 members
Home / Discussions / Web Development
   

Web Development

 
QuestionPasting screen shot in text field in web application Pin
Pramod K Singh20-Jan-13 22:17
Pramod K Singh20-Jan-13 22:17 
AnswerRe: Pasting screen shot in text field in web application Pin
Sandeep Mewara20-Jan-13 22:46
mveSandeep Mewara20-Jan-13 22:46 
QuestionCreating Mobile Apps with HTML5 Pin
Sunitha2716-Jan-13 5:11
Sunitha2716-Jan-13 5:11 
AnswerRe: Creating Mobile Apps with HTML5 Pin
Sandeep Mewara16-Jan-13 6:12
mveSandeep Mewara16-Jan-13 6:12 
AnswerRe: Creating Mobile Apps with HTML5 Pin
Richard MacCutchan16-Jan-13 6:13
mveRichard MacCutchan16-Jan-13 6:13 
QuestionHTML5 Audio Stream Pin
Adam Jasper16-Jan-13 2:14
Adam Jasper16-Jan-13 2:14 
QuestionAbout mobile web debugger Pin
tidelgl13-Jan-13 19:23
tidelgl13-Jan-13 19:23 
QuestionUnable to start service using WMI Pin
only1rb11-Jan-13 6:22
only1rb11-Jan-13 6:22 
This is a 2 part question. I have a service that has a name "Ads 1", "Ads 2". They take a parameter of "1" and "2".

1. When I invoke the method to start the service "Ads 1" the " 1" is truncated, so I get "Ads" being passed. How can I stop this and force it to be "Ads 1"? All my other services start, stop, pause, everything else just fine, but they don't have a space then number either. What am I missing?

2. I am trying to pass the parameter with the startservice. I am using a hardcoded parameter value(1) for now to get it to work in testing. Due to the fact that I am unable to get the service to start I am not sure the parameter is being passed. How can I check to see if the paramter is being passed and/or Am I doing this right way?

Any help is appreciated. Thank you.

<pre lang="c#">  
        int iPos; 
        int iCount = 0; 
        string sService; 
 
        try 
        { 
            ConnectionOptions conOpts = new ConnectionOptions(); 
            conOpts.Username = ddlServers.SelectedItem.Text.ToString() + "\\" + System.Configuration.ConfigurationManager.AppSettings["AdminUser"].ToString(); 
            conOpts.Password = System.Configuration.ConfigurationManager.AppSettings["AdminPassword"].ToString(); 
            System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\\\" + 
                                                                                          ddlServers.SelectedItem.Text + 
                                                                                          "\\root\\cimv2", conOpts); 
 
            while (iCount < lboxServices.Items.Count) 
            { 
                if (lboxServices.Items[iCount].Selected) 
                { 
                    iPos = lboxServices.Items[iCount].Text.IndexOf("-"); 
                    sService = lboxServices.Items[iCount].Text.Substring(0, iPos).Trim(); 
 
                    System.Management.ObjectQuery oQuery = new System.Management.ObjectQuery("select * from Win32_Service Where Name='" + 
                                                                                             sService + 
                                                                                             "'"); 
                    ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery); 
                    ManagementObjectCollection oReturnCollection = oSearcher.Get(); 
 
                    if (oReturnCollection.Count > 0) 
                    { 
                        foreach (ManagementObject oReturn in oReturnCollection) 
                        { 
                            if (oReturn.GetPropertyValue("State").ToString().ToLower().Equals("stopped") || 
                                oReturn.GetPropertyValue("State").ToString().ToLower().Equals("paused")) 
                            { 
                                String[] sArgs = new string[] { "1" }; 
                                oReturn.InvokeMethod("StartService", sArgs); 
                            } 
                        } 
                    } 
 
                    lboxServices.Items[iCount].Text = sService + " - " + CheckService(ddlServers.SelectedItem.Text, sService); 
                } 
                iCount++; 
            } 
        } 
        catch (Exception err) 
        { 
            lboxServices.Items.Add("Error: " + err.Message.ToString()); 
        }

QuestionHelp! Pin
crood5-Jan-13 20:05
crood5-Jan-13 20:05 
AnswerRe: Help! Pin
Sandeep Mewara5-Jan-13 20:27
mveSandeep Mewara5-Jan-13 20:27 
Questiondrop down menu pushes the content down similar to ibm.com Pin
Mohamed Samir29-Dec-12 23:59
Mohamed Samir29-Dec-12 23:59 
AnswerRe: drop down menu pushes the content down similar to ibm.com Pin
Sandeep Mewara30-Dec-12 0:13
mveSandeep Mewara30-Dec-12 0:13 
Questiongoogle map include in contact.aspx page Pin
Member 819678127-Dec-12 20:50
Member 819678127-Dec-12 20:50 
AnswerRe: google map include in contact.aspx page Pin
vbmike28-Dec-12 8:59
vbmike28-Dec-12 8:59 
AnswerRe: google map include in contact.aspx page Pin
Sandeep Mewara5-Jan-13 20:28
mveSandeep Mewara5-Jan-13 20:28 
AnswerRe: google map include in contact.aspx page Pin
Zamshed Farhan15-Jan-13 4:12
Zamshed Farhan15-Jan-13 4:12 
QuestionUsing Developer Tools Pin
Phanindra26127-Dec-12 1:59
Phanindra26127-Dec-12 1:59 
AnswerRe: Using Developer Tools Pin
Zamshed Farhan12-Jan-13 5:46
Zamshed Farhan12-Jan-13 5:46 
AnswerRe: Using Developer Tools Pin
Zamshed Farhan12-Jan-13 5:48
Zamshed Farhan12-Jan-13 5:48 
QuestionSSRS Report Conversion to PDF Pin
Vinay Meka22-Dec-12 0:58
Vinay Meka22-Dec-12 0:58 
AnswerRe: SSRS Report Conversion to PDF Pin
Sandeep Mewara5-Jan-13 20:34
mveSandeep Mewara5-Jan-13 20:34 
QuestionCould not load file or assembly Pin
L Viljoen20-Dec-12 1:57
professionalL Viljoen20-Dec-12 1:57 
AnswerRe: Could not load file or assembly Pin
ArpitDubey28-Dec-12 8:50
ArpitDubey28-Dec-12 8:50 
QuestionHow should I measure scroll position in different browsers Pin
woomla17-Dec-12 21:52
woomla17-Dec-12 21:52 
AnswerRe: How should I measure scroll position in different browsers Pin
Zaf Khan19-Dec-12 5:46
Zaf Khan19-Dec-12 5:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.