|
How to get the assembly version in C#? I mean it is easy to get it for the assembly from which the code is executing by using the GetExecutingAssembly(), but how to get it for any other assembly?
Thanks.
|
|
|
|
|
Is the assembly loaded? If so, the current AppDomain should be able to retrieve it using GetAssemblies , in which case you could just check the version property. Otherwise, you could load it using Assembly.Load or Assembly.LoadFrom .
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Exactly my point. Now why in the Earth I need to load the whole assembly to get it version? Seems little bit clumsy, doesn't it?
|
|
|
|
|
|
Clumsy? No, not really. My assumption was that you were interested in using the assembly in some way versus just inspecting its version.
If all you want is the version, and nothing else, I would advise using the System.Diagnostics.FileVersionInfo class.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Yes, you are right. Thanks for your help.
|
|
|
|
|
Hey!
I have a Windwos Library control(own made control) that i have added to my main program.
In this Windows Librar control i have a richtextbox that i add test to realy fast.
The problem:
When hitting a button or somthing during this contrl/richbox is adding data nothing happens? the buttens simes like its pressed but no event fires?
I have tryed to disconnect the Windows Library control and if i do this all is working fine, so its not any other part of my program that makes this problem.
Is there any way to add data to richTextbox in a fast way(and auto scroll to the bottom) without interfarens with rest of the GUI?
Best Regards
SnowJim
|
|
|
|
|
Can someone please help me with the code for reading nodes from an xml file one at a time. Could you please write an example. Is the value of a node the text it contains or is the attribute of a node the text it contains??
The XML file looks like this:
<test>
<question>Which fruit is in the following picture?</question>
<answerA>Apple</answerA>
<answerB>Orange</answerB>
<answerC>Pear</answerC>
<answerD>Plum</answerD>
<correct>A</correct>
<explanation>The picture is of a apple.</explanation>
</question>
<question>
.....
</question>
</test>
|
|
|
|
|
go to MSDN.microsoft.com and type "reading XML in .NET framework" into search box.
Or have a look at <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmltextreaderclasstopic.asp" rel="nofollow">System.Xml.XmlTextReader</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmltextreaderclasstopic.asp" target = "_blank" rel="nofollow">^</a>] .
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
How I do to select multiple files in Windows Explorer, and run one command like "Execute", and all files need be passed as multiple parameters to one application.
I have tried the function AddContextMenuItem in this article: http://www.codeproject.com/tools/cpzipstripper.asp
but works only to one instance, if I try multiselect files and click "Execute", opens multiple instances of my application, instead of one instance with multiples args...
Thank you for all
|
|
|
|
|
There are two approaches that come to mind.
First is write a dynamic shell context menu handler that stores all the files selected in the IShellExtInit::Initialize method. This is pretty easy in C++ using one of the wizards you can find here on the Code Project. In C# it's a bit more hairy though.
The easier approach in C# would be to modify your app so that it only runs a single instance and any additional instances just pass the command line to the first instance. I'm pretty sure there are examples here of C# single instance apps. Then it's just a matter of passing the command line info. Search on single instance apps in
C# here and you should get some working code so you can see various methods to pass info from one instance to another.
|
|
|
|
|
Does anyone here know where I can find some code which depicts thie behaviour in the topic? I mean I want to be able to grab one or more items, drag them to a different place and drop so that the items are reordered. Thanks for any help!
|
|
|
|
|
|
Hi everyone! I have this strange problem: I have the main form and the main in which I invoke Application.EnableVisualStyles(). When I run the program almost everything works fine. Hovewer, I have a seccond window which inherits from System.Windows.Forms.Form. It's just an information window with a ListBox and an OK button. This button just calls Dispose() and it's has the System FlatStyle. When I click the button the program crashes. When I comment out the EnableVisualStyles() call, everything works fine, I dont't even have to change the buttons visual style to Standard. What should I do to make it all work?
|
|
|
|
|
And what it says when it crashes?
btw Be sure you call Application.DoEvents() after you call Application.EnableVisualSyules . Probably it's not this problem but sure it's not bad idea
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Well, it doesn't say anything, just crashes and gives me the possibility to choose a debugger. However, when I do choose one it just displays empty screen inside te Visual Studio editor.
|
|
|
|
|
|
Well, yes, that's true , I get an System.Runtime.InteropServices.SEHException, but I can't get any more info than that. Pls help.
|
|
|
|
|
|
Thanks dnh! That's exaxtly the problem I am having right now. But the DoEvents() method doesn't work in my case, I don't know why. I think I'll turn to the manifest instead. Is this true that I have to have an Appname.exe.manifest file in the same direcotry where my exe file is? It doesn't seem very appealing to me.
|
|
|
|
|
|
Hey!
I am using:
<br />
rtIncomeLogg.HideSelection = false;<br />
rtIncomeLogg.SelectionStart = rtIncomeLogg.TextLength;<br />
rtIncomeLogg.ScrollToCaret();<br />
To scroll my RichTextBox.
The problem with this is that the area that the RichTextBox i showing is blank, not until i move the scroolbar i can se the data.
My fist thougt whas tat it was alot of \n that was appendet to the text, but is isent?
When i scrool(manual) up a bit then down again i can see that the text is reaching all the way down(the blank have disapared)?
I have also tryed this Code:
<br />
rtIncomeLogg.Focus();<br />
rtIncomeLogg.Select(rtIncomeLogg.TextLength, 1);<br />
rtIncomeLogg.Select();<br />
This works fine, BUT i need to be able to type in other controls while data is added to my richTextBox, and by using Focus on this richTextBox i can use any of the other text boxes to write in.
Do you know how to solve this problem?
Best Regards
SnowJim
|
|
|
|
|
if i use the first code i posted above:
and efter the data have been added and i only see the blank Rich text box with the vertical scroll bar at value MAX.
If i press the ^(Arrow up) on the vertical scoll bar once, then it shows the data in the text box and the scroll value is still set to value MAX.
Maby my problem could be fixed by fire the ^(arraow up) event on the scrollbar right after the scroll ToCaret is done?
But how do i fire this event?
Best Regards
SnowJim
|
|
|
|
|
Is there nowone that have any ides?
i cant use any APIs eather.
BestRegards
SnowJim
|
|
|
|
|
Is this a problem i will have to live with? or is there any solution to it? Maby its just me that haves this problem?
BestRegards
SnowJim
|
|
|
|