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 7736107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:39:50+00:00 2026-06-01T07:39:50+00:00

I need to pass a list of strings as parameter to a console application

  • 0

I need to pass a list of strings as parameter to a console application (developed with C#).
The console application is started with System.Diagnostics.Process.Start like:

string fname = "testDoc";
List<string> myList;  //initialized elsewhere

Process console = Process.Start("Client.exe", "-filename:"+fname+ " -list:"+myList);

How can I achieve this?

  • 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-01T07:39:51+00:00Added an answer on June 1, 2026 at 7:39 am

    Running

    Process console = Process.Start("Client.exe", "-filename:" + fname + " -list:" + myList)
    

    will execute myList.ToString() and will translate to:

    Client.exe -filename:testDoc -list:System.Collections.Generic.List`1[System.String]
    

    which is not what you want to achieve. Try

    Process console = Process.Start("Client.exe", "-filename:" + fname + " -list:" + String.Join(",", myList)) 
    

    or something similar.

    UPDATE

    Of course, you might want to consider some more civilized methods of passing data to that process. Common ways include:

    • database
    • file system (files)
    • WCF

    UPDATE

    Given the context supplied in the comment, I’d opt for a completely separate windows service running on the server (non-stop, not invoked) with database used for synchronization:

    • database with table Tasks with columns input data, output data and any other you might want (like some dates or user IDs)
    • webpage inserting rows into that table as data-to-be-processed appears
    • windows service repeatedly (every x seconds) querying the table for unprocessed tasks and performing the tasks if there’s any; results get saved in the output data column
    • on user request webpage queries for a given task and displays it’s status, showing the output data if it’s there

    This is much more robust and scales much better with growing user traffic. The service itself would ideally spawn worker threads for separate tasks to take advantage of multiple cores. With such architecture in place, there’s lots of ways to optimize performance and monitor the tasks.

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

Sidebar

Related Questions

I have a list of strings that I need to pass to a process
I have a list of integers or of strings and need to pass it
i need to pass a parameter list stored in a dictionary to a function
i need to pass a long list of Ids from one page to another,
Need to pass get parameter without value and without = symbol to utilize external
I have a rather silly question, I need to pass a parameter from one
I have a method that uses a list which I need to pass into
I need to pass an array of strings from the backing bean to the
I'd like to pass a class property (or a getter/setter if need be) reference
I need to pass all my current page cookies to other server with request:

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.