|
Hello,
As Luc has told you if the only thing you need is to launch the application associated with doc file, you can use Process class. On the other hand if you really need to retrieve application path then you will need to use various methods for reading windows registry as the information is stored in system registry.
|
|
|
|
|
Anyhow I found the answer my self already.
It's all in the registry.
in order to retrive which application is associated with the extention you need to access the OpenWithList key for the extention.
all the extentions are located under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
there you can find your extention and all you need is to open the OpenWithList key
i.e.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc\OpenWithList
in this key you will find DWORD's a,b,c
each represent and application to use in order to open this file.
"a" is the default.
|
|
|
|
|
I want to store Controls(All Buttons) of my form in array list.Is it possible.
|
|
|
|
|
Use generic collection, it's better. But you can use ArrayList as well but remember that ArrayList stores type Object so when you are retrieving you have to cast them.
List list = new List();
|
|
|
|
|
Hi,
you can store anything you like in an ArrayList or any other kind of collection (Hashtable, SortedList, ...).
you can store all kinds of objects with a common base type (such as Control) in a List of that type, or any other kind of collection capable of holding your base type (Dictionary, ...).
You probably don't have to create a new collection since each Control (and hence each Form) already has a collection holding ALL its Controls.
Example: if you want to do something to all the Buttons on myForm, this would be sufficient:
foreach(Control c in myForm.Controls) {
Button btn=c as Button;
if (btn!=null) {
btn.PerformClick();
}
}
Warning: a foreach on an enumerator will not allow you to modify the collection, so the above loop would not allow you to add or remove buttons; you would need a for or while loop for that.
|
|
|
|
|
|
Don't forget that the form also may have containers (panels, group boxes etc) which may have buttons in them. You will need a recursive structure to get ALL the buttons on a form.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Its better if you use Hashtable cause here in key you can also save the ID of that button.
Cheers!!
Brij
|
|
|
|
|
or Dictionary<t,t>, to make use of generics
Regards,
Lev
|
|
|
|
|
You don't need to do that because the Name property is the ID. Since it's already in the control, no need to store it outside of its current context.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
They're already in a list (look at the controls property). Don't forget that a container control (like a panel or group box) will probably have child controls, and will therefore have their own list. It's like a singly linked list.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi, we are doing a project using C# and would like to release it as an OpenSource software. However, we are using a few DLL files which ofcourse we have made and are willing to share the source code for further development. Under such circumstances, is it violating the Open Source license?
Thanks,
Abhishek.
|
|
|
|
|
If its your code, then you can't break your own license If you want to share the source for them as well, go for it.
It also depends on what Open Source license you choose. Have a read on wikipedia about what license is suitable for your goals.
|
|
|
|
|
I prefer to get DLLs along with the source code.
I think an open-source project should allow people to read and compile the code, but not require them to.
I don't like having to build other peoples' code, though at least it's easier with .net (due to limited operating system and compiler support ).
One of my worst experiences was trying to build an OpenVMS version of a Perl module (a driver for RDB); I never got it to compile.
My best experience was compiling the MySQL ADO.net connector, the only problem is all the warnings about Obsolete methods.
|
|
|
|
|
Hello
I want create a file fox (*.dbf) which has 3 fields (ID, NAME, MOBILE). Then I need insert data to this file. Example:
1, Mr Join, 0912555666
2, Ms Angela, 0123666777
----------------------------------------
You can help me? There are examples as possible. Thank you very much!
|
|
|
|
|
No idea what you are asking. Please clarify.
|
|
|
|
|
Why DBF, this format is no longer used in any applications that I know of (possible exception is Foxpro). I suggest you look into another database, Access or SQL Express and there are a couple of others out there that will be a better option than DBF.
You cannot "write" to a .DBF file using filestream, you have to create a connection to the file, you may be able to use the Jet engine, try connectionstrings.com
You could also use XML for small data sets.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How can I print content of richtextBox in C# ?
Hello Friends
|
|
|
|
|
|
is there any easier way to do it
or
can we do it through another control
Hello Friends
|
|
|
|
|
well it is pretty easy by itself just dig into the sample code
Regards,
Lev
|
|
|
|
|
That's about as "hand to you on a silver platter" as it's going to get.
|
|
|
|
|
Hi friends...!
I'm developing a exe which converts pdf file to jpg/image file.
I searched web to find some code.But I couldnt find any.
Can anyone help me to do this.
I know this is a simple task.But I'm new to C#.
I'm happy if anyone can guide me to achieve my task.
I'm using VS 2008 express edition.
Thank you.
charithmax
|
|
|
|
|
Try iTextSharp[^] this is a PDF lib for .net
Regards,
Lev
|
|
|
|
|
I download a sample file in this site http://msdn.microsoft.com/en-us/library/bb676897.aspx
I'd like to use "Windows Live ID Client Sample" with delphi 2007 or delphi7.
I tried to import " Microsoft.WindowsLive.Id.Client.dll" but Delphi is just made connect functions.
When I show with VS2008, I can use my features function.
How can I use this dll or not?
Thank you
|
|
|
|