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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:34:23+00:00 2026-05-21T00:34:23+00:00

I have a C# WinForm App that I created to store files in a

  • 0

I have a C# WinForm App that I created to store files in a seperate secure location on the hard drive. I am trying to add functionality to the program by adding a right-click context menu so when a user right-clicks a file (or group of files) in windows, my program is there in the context for them to select. No problem there, I have that part worked out. What I need is to programmatically get that list of files and send it to the program so they are listed in the listbox already.

I am already doing something similar with a multiselect in an OFD, but I dont want them to have to open the program, select browse, find the files and select them when they already have them selected in windows.

There are a ton of programs out that have this functionality (like properties plus, textpad, etc…) I just need a shove in the right direction to help me figure this out.

Thanks in advance,

Dave

  • 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-05-21T00:34:24+00:00Added an answer on May 21, 2026 at 12:34 am

    If I’m correctly understanding what you’ve already implemented, then all the files should appear as arguments on the program’s command line. You just need a way of extracting each of those file paths and displaying them in your list view.

    In C#, the following code will display a message box containing each argument on the command line:

    static void Main(string[] args)
    {
        foreach(string arg in args)
        {
            MessageBox.Show(arg);
        }
    }
    

    But in case you don’t want to access these in the Main method, you can also use the Environment class, which provides the static GetCommandLineArgs method. It returns the same array of strings containing the arguments, and you can loop through it the same way.

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

Sidebar

Related Questions

I have a winform app that has tabcontrols that are 3 layers deep. I
I have a winform app that fills a lot of its dropdomn fields fram
I have a Winform App that uses a 3rd Party Library of Controls, DevExpress.
I have a medium sized WinForm App ( 1 Form that hosts 40 user
We have a winform app that has been in development for some time. It
I have a winform app that needs to be aware of when a SQL
I have a C# 4.0 Winform app that I just upgraded from 3.5 to
I have a fairly large CRUD WinForm app that has numerous objects. Person, Enrollment,
I have a Winform app that has a backgroundWorker thread and does all operations
I have a Winforms app that was originally created in vs 2005 and that

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.