Click here to Skip to main content

Web Development

AnswerRe: Pasting screen shot in text field in web application [modified] PingroupStyleTech Solutions Ltd4-Feb-13 7:16 
QuestionCreating Mobile Apps with HTML5 PinmemberSunitha2716-Jan-13 6:11 
AnswerRe: Creating Mobile Apps with HTML5 PinmvpSandeep Mewara16-Jan-13 7:12 
AnswerRe: Creating Mobile Apps with HTML5 PinmvpRichard MacCutchan16-Jan-13 7:13 
AnswerRe: Creating Mobile Apps with HTML5 Pinmemberrg1024-Jan-13 2:37 
QuestionHTML5 Audio Stream PinmemberAdam Jasper16-Jan-13 3:14 
QuestionAbout mobile web debugger Pinmembertidelgl13-Jan-13 20:23 
QuestionUnable to start service using WMI Pinmemberonly1rb11-Jan-13 7: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; 
            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") || 
                                String[] sArgs = new string[] { "1" }; 
                                oReturn.InvokeMethod("StartService", sArgs); 
                    lboxServices.Items[iCount].Text = sService + " - " + CheckService(ddlServers.SelectedItem.Text, sService); 
        catch (Exception err) 
            lboxServices.Items.Add("Error: " + err.Message.ToString()); 

QuestionHelp! Pinmembercrood5-Jan-13 21:05 
AnswerRe: Help! PinmvpSandeep Mewara5-Jan-13 21:27 
Questiondrop down menu pushes the content down similar to PinmemberMohamed Samir30-Dec-12 0:59 
AnswerRe: drop down menu pushes the content down similar to PinmvpSandeep Mewara30-Dec-12 1:13 
Questiongoogle map include in contact.aspx page PinmemberMember 819678127-Dec-12 21:50 
AnswerRe: google map include in contact.aspx page Pinmembervbmike28-Dec-12 9:59 
AnswerRe: google map include in contact.aspx page PinmvpSandeep Mewara5-Jan-13 21:28 
AnswerRe: google map include in contact.aspx page PinmemberS.M. Zamshed Farhan15-Jan-13 5:12 
QuestionUsing Developer Tools PinmemberPhanindra26127-Dec-12 2:59 
AnswerRe: Using Developer Tools PinmemberS.M. Zamshed Farhan12-Jan-13 6:46 
AnswerRe: Using Developer Tools PinmemberS.M. Zamshed Farhan12-Jan-13 6:48 
AnswerRe: Using Developer Tools Pinmemberrg1024-Jan-13 2:40 
QuestionSSRS Report Conversion to PDF [modified] PinmemberVinay Meka22-Dec-12 1:58 
AnswerRe: SSRS Report Conversion to PDF PinmvpSandeep Mewara5-Jan-13 21:34 
QuestionCould not load file or assembly PinmemberChona117120-Dec-12 2:57 
AnswerRe: Could not load file or assembly PinmemberArpitDubey28-Dec-12 9:50 
QuestionHow should I measure scroll position in different browsers [modified] Pinmemberwoomla17-Dec-12 22:52 

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

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

Advertise | Privacy | Mobile
Web02 | 2.8.150414.1 | Last Updated 19 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid