|
Hi.
I am wondering how one goes about letting a user of a Windows forms app select a certain file at a certain location and then the application does whatever with the file.
What I am refering to is similar to what we see when we are attaching files in an email, one presses a button and then a dialog box opens that enables the user to browse to a certain location and select a file that is then attached to the email. I would like to know how one can get the app to work with the file chosen by the user at some location on his/her computer?
Thanks,
F
|
|
|
|
|
Look into the OpenFileDialog class on MSDN.
When you call the ShowDialog function, a browse dialog appears. You can set filters, default directory, ...
Hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
OpenFileDialog - its in the components of Visual Studio.
|
|
|
|
|
Hi.
I am wondering how one goes about letting a user of a Windows forms app select a certain file at a certain location and then the application does whatever with the file.
What I am refering to is similar to what we see when we are attaching files in an email, one presses a button and then a dialog box opens that enables the user to browse to a certain location and select a file that is then attached to the email. I would like to know how one can get the app to work with the file chosen by the user a some location on his/her computer?
Thanks,
F
|
|
|
|
|
If you look here:
System.Windows.Forms.FileDialog
System.Windows.Forms.FolderBrowserDialog
You will get what you want.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Actually,
I found one article on this in codeproject,but that source giving some probem at getRegistryHandle function.Please update me how can i solve that.
|
|
|
|
|
Hi,
I'm writing a web service with C#. I'm using VS.NET 2005 but I can't understand the way VS.NET create a web service (EX: I can't find the .wsdl file).
Can you explain it?
Thanks,
Hung.
Hung
|
|
|
|
|
|
Hi,
I am working on a web application in ASP.net & C# .For one of the utilities on my site, i need to use an available VC++ project.
This VC++ project produces an exe as its output.
I tried changing the output type of the VC++ project to .dll, but it doesn't help and after this, the project itself stops working.
Can someone please tell me as to how to use this VC++ project into my web application?
Thanks.
|
|
|
|
|
There're some very big issues involved here. If your VC++ project produces an exe, it is either a Windows or Console application project. So look bellow. This would work with VS2008, I don't remember how to do it using older versions.
1.- [Easiest] Is the VC++ project a managed project? Go to project properties and take a look under "Common Properties", if this tab works. Allows you to change "Targeted Framework", add references or so. It is a managed project. Solution: Just changed your project output type: Go to "Configuration Properties" > "General" > "Configuration Type" and change it to "Dynamic Library (.dll)". And just try placing the reference in your web.config, it should work. Down side. Global funcions and not managed types are not going to work for you ASP.NET site. All types you'd like to use must be marked as "__gc" or "__value". Take a look to this MSDN link > ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/dv_vclang/html/63b1e7ab-d1c8-4582-aa89-21bfddf694a9.htm
2.- [Hardest] Your project is a native one. Solution: First, change the project type, same as above (not mandatory, exe also can export functions). You'll have to make sure you're exporting the funcions you'd like to use from managed code. To see exported functions use "dumpbin.exe /EXPORTS <exe or="" dll="" file="">" from VS command prompt. Then you'll have to create a "wrapper" managed library to access to unmanaged, see this one to use native functions from managed code > ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/fxref_mscorlib/html/36830e35-7f2e-b1fa-87ca-144346051059.htm . Down side, most web hostings won't allow you to access to native code, or at lest no more than .NET native libraries or Windows API.
Hope it'll help
|
|
|
|
|
Hi
how can i check whether a screen saver is running or not.
Shajeel
|
|
|
|
|
tip #1: use google :>
tip #2: http://www.neowin.net/forum/lofiversion/index.php/t298659.html
|
|
|
|
|
Distortation/flickering occur while Open one form & Close another in c#(Windows)
On some Event(e.g Button Click) on Form1
Form2 f=new Form2(ref newDataSet);
f.show();
Form1.close();
i'm also passing some DataSet,Variable to the constructor of Form2
Sushil
-- modified at 5:41 Wednesday 5th April, 2006
|
|
|
|
|
hi everyone,
Here is my question:
In a WebForm we have taken two dropdownlists say dropdownlist1 and dropdownlist2.In the drop down list1 there is(jpeg image,textdocument) attached to it.
We have taken one folder(folder name temp) on the desktop.This folder contains(jpeg image1,textdocument1,jpegimage2,textdocument2 ).
now my question is on the dropdownlist1 when i click on jpegimage the file which is there on the desktop those two jpeg images i.e,image1 and image2 should be displayed on the dropdownlist2.
plz give me code for this program
thanku,
byeee
murali
|
|
|
|
|
Do your own homework
Ed
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
I have a standard C library file : "abc.dll". Now I want to reuse it with C# (VS.NET 2005). How can I do this?
Thanks,
Hung.
Hung
|
|
|
|
|
|
You must use InteropServices...
<br />
using System.Runtime.InteropServices<br />
then DllImport attribute
<br />
[DllImport("User32.dll")]<br />
public static extern int MessageBox(int h, string m, string c, int type);<br />
Then you are avaible to use MessageBox function
all code will be locking such the following:
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
class MainClass <br />
{<br />
[DllImport("User32.dll")]<br />
public static extern int MessageBox(int h, string m, string c, int type);<br />
<br />
static int Main() <br />
{<br />
string myString; <br />
Console.Write("Enter your message: ");<br />
myString = Console.ReadLine();<br />
return MessageBox(0, myString, "My Message Box", 0);<br />
}<br />
}<br />
|
|
|
|
|
Thanks!
But my "abc.dll" file is not registered in Windows, and I don't want to register it! Do you have other ideas?
Hung
|
|
|
|
|
Put it into the same directory where your .NET executable is.
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Can you explain more details!!
I tried to add reference to standard C .dll file but VS.NET does not allow me to do.
Thanks,
Hung
|
|
|
|
|
i've created my c# application and now i want to setup file for it. The problem i'm facing is that my application requires some actions to be performed during setup such as:
copy E:\lib\myodbc3S.lib E:\\Windows\System32
copy E:\lib\myodbc3.dll E:\\Windows\System32
copy E:\lib\myodbc3.lib E:\\Windows\System32
copy E:\bin\myodbc3i.exe E:\\Windows\System32
copy E:\bin\myodbc3m.exe E:\\Windows\System32
copy E:\bin\myodbc3c.exe E:\\Windows\System32
copy E:\doc\*.hlp E:\\Windows\System32
and afyer this call a the regsvr32 command. How do I do this? I read something about an insatller class or something but i couldn't understand.
|
|
|
|
|
Hello,
I have problem with updating my form after I've executed an update or insert query.
How can I refresh my windows form in c#.
Thx
wistiti 5
|
|
|
|
|
no need to refresh the page to get updated.
for example:
f1() : write a function to display all the information on the page
f2(): write a separate function for doing modification and updating the database.
now u want the page to have the updated value to b displayed, for that wat u have to do is call the f1() process again..
sathy
|
|
|
|