Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

console application need call open dialog box to let the user select a file .. Is that possible??

Posted on 2006-07-09
5
Medium Priority
?
569 Views
Last Modified: 2008-02-01
I am thinking of developing a console application and my dilema right now is how to call the open dialog box from a console application, once after user select a file, i need do some data manipulation based on the user selected filename, i know if i use a windows form applicaton, the above task can be achieved freaking easy, but it was very unfortunate that
my boss asked to develoe a console application to achieve the above task..

Is that possible???

 
0
Comment
Question by:nyee84
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 17070273
Sure, just do this:

1) Add a reference to System.Windows.Forms.dll to the project

2) Use some code similar to this:

Imports System.Windows.Forms

Module Module1

  Sub Main()

    Dim dialog As New OpenFileDialog

    dialog.ShowDialog()

  End Sub

End Module

Bob
0
 

Author Comment

by:nyee84
ID: 17070542
I got an error message when adding reference to windows.forms.dll

A referece to System.Windows.Forms.dll could not be added. Converting the type library to a .NET assembly failed. Type Library System_Windows_Forms was exported from a CLR assembly and cannot be re-imported as CLR assembly.

What does it mean>> How to resolve it?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17072186
Whoa! Where are getting that from?  What tab were you on on the Add Reference dialog?  Were you on the COM tab?

Bob
0
 

Author Comment

by:nyee84
ID: 17078512
Hi Bob,

I have selected COM tab and selected " System.Windows.Forms.dll" and when i tried click ok i have encountered the above mentioned error message..

Nyee
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17080650
Nyee,

That's what I thought.  System.Windows.Forms.dll is on the .NET tab, not the COM tab.

Bob
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question