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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:16:37+00:00 2026-06-08T05:16:37+00:00

In the following c# class displaying a Windows.Forms.OpenFileDialog how could I store the data

  • 0

In the following c# class displaying a Windows.Forms.OpenFileDialog how could I store the data path into the variable called m_settings?

private SomeKindOfData m_settings;
public void ShowSettingsGui()
{
    System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
    ofd.Multiselect = true;
    ofd.Filter = "Data Sources (*.ini)|*.ini*|All Files|*.*";
    if (ofd.ShowDialog() == DialogResult.OK)
    {
        string[] filePath = ofd.FileNames;
        string[] safeFilePath = ofd.SafeFileNames;
    }
        m_settings = //<-- ?
}
  • 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-08T05:16:39+00:00Added an answer on June 8, 2026 at 5:16 am

    This should do the trick:

    m_settings = ofd.FileName;
    

    EDIT: Actually, now I’m not sure if you wanted the folder path. In that case:

    m_settings = Path.GetDirectoryName(ofd.FileName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following shows the code and screenshot for displaying data in listview containing 3 textview
following is my code: In MainActivity.class private OnCheckedChangeListener alert_on_off_listener = new OnCheckedChangeListener(){ public void
For following class mapping: <class name=Person table=Person discriminator-value=null> <id name=ID column=ID > <generator class=identity/>
The following class acts as a simple cache that gets updated very infrequently (say
The following class is not thread-safe (as proven in Proving the following code not
The following class is used by another program. When it is accessed, it throws
I created a following class within a namespace Global namespace Global { public static
I have the following class written by someone else that I'm trying to understand
I have defined the following class using COM to use the IGroupPolicyObject using C#.NET:
I have the following class public class MenuVeiculo { public string Nome { get;

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.