Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7895345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:37:15+00:00 2026-06-03T07:37:15+00:00

I have written an windows service application in c# to find wether the applications

  • 0

I have written an windows service application in c# to find wether the applications configured are running in the process or not. For instance if I have configured OUTLOOK and checking in the application process list if outlook is open/closed if my application didnt find OUTLOOK in process list then it emails me saying your application OUTLOOK is either closed or crashed.

When I am trying to run this in code it is sending email only if OUTLOOK is closed but when I am running using Service it is sending an email even if OUTLOOK is running.

Can anyone please explian me why my Service is not able to recognize applications in application process list.

    public void GetListofApplications(List<string> applicationsInConfig)
    {
        if (AppsInActive.Count > 0)
        {
            AppsInActive.Clear();
        }
        StringBuilder sb = new StringBuilder();
        foreach (Process p in Process.GetProcesses("."))
            try
            {
                if (p.MainWindowTitle.Length > 0)
                {
                    APPsInProcess.Add(p.ProcessName.ToString());
                }
            }
            catch(Exception ex)
            {
                Logger.Log("Exception in Finding Process" + ex);
            }

        foreach (var application in applicationsInConfig)
        {
            if (APPsInProcess.Contains(application))
            {
                AppsActive.Add(application);
            }
            else
            {
                AppsInActive.Add(application);
            }
        }

        foreach (var item in AppsInActive)
        {
            Logger.Log("Following application is either crashed/closed :" + item);
        }

        Helper.EmailSetup setup = new Helper.EmailSetup();
        setup.ApplicationFailedEmailSetup(AppsInActive, DateTime.Now);
               }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:37:16+00:00Added an answer on June 3, 2026 at 7:37 am

    try to check OUTLOOK in this way

                var _proc = Process.GetProcesses().Where(o => o.ProcessName.Contains("OUTLOOK"));
                if (_proc.Count()>0)
                {
                }
    

    Just try at first find only outlook, if this doesn’t help, comment please

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a C# Windows Forms application, not a service (it is only
I have written two different applications running as windows services. Each application represents one
I have written a windows service application which is installed on my PC. There
We have a Windows service written in C#. it is crashing after running for
I have written a windows service in c# that's designed not to stop or
I have a application written in C#, installed as a [WCF] windows service, which
I have a Windows Service (written in .NET 1.1) running under a specific user
I have just written a program to run as a Windows Service Application, GasMeterMonitoring;
I have written an application in C, which runs as a Windows service. Most
I have written a Windows service to collect information from all of our SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.