|
ptr2void wrote: Didnt quite get this line.. What might break??
Imagine that you installed two different applications that use the same control (e.g. Excellent.Grid.dll ). Your app will find the Excellent.Grid.dll file in two different directories (e.g. C:\Program Files\Excellent Calendar and C:\Program Files\Excellent Cookbook), will delete one copy since they are exactly the same and... one application will stop working.
|
|
|
|
|
You could get the MD5 hash of the file, of course this may take a while. I recomend against your course of action strongly because you may screw something up.
|
|
|
|
|
Hi,
I am using a FolderBrowserDialog to get the user to select a path. I then display the selected path in a text box using the FolderBrowserDialog.SelectedPath property. It works well with anything that's not a non-english version of Vista.
On an Italian version of Vista, for example, the FolderBrowserDialog will display the localized folders, where "Program Files" is "Programmi", etc.
The problem is, if the user selects "C:\Programmi" in the FolderBrowerDialog , when I display the selection in a textbox, it displays "C:\Program Files". From what I understand, the "real" name of "C:\Programmi" is "C:\Program Files" and "Programmi" is just a display name (new to Vista, in XP the display name and real name were both "C:\Programmi").
So my question is: How do I get the display name so that I can show it to the user instead of the real name? Is there a property in either Path or DirectoryInfo or Directory that would do the "Translation"?
Any help on this would be much appreciated!
Hugo Migneron
|
|
|
|
|
<!-- <?xml version="1.0" encoding="utf-8"?>
<BookMarkInfo>
<res>
<X>1.02</X>
<Y>6.58</Y>
<Z>3.26</Z>
</res>
<sirt>
<X1>5.02</X1>
<Y1>3.58</Y1>
<Z1>5.26</Z1>
</sirt>
</BookMarkInfo> -->
I need to parse the above XML file and store in Data structure.
Struct BookMarkInfo
{
double x,y,z;
String bkMrkName;
}StBk[10];
StBk[0].bkMarkName = res;
StBk[0].X=1.02;
StBk[0].Y=6.58;
StBk[0].Z=3.26;
StBk[1].bkMarkName = sirt;
How can I store it?
Thanks
Ash
|
|
|
|
|
I suspect you need to do some reading on XPath and the XML DOM.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a small problem, I am writing an updater for my app. So, it finds the folder my exe is in, and it has a new copy of that exe amongst the files to copy in. I want to show the different version numbers for both exes. This is easy. However, loading the assembly means I can't copy over the file. I've had no luck in trying to load the assembly in another app domain. It doesn't work when then file is not in a subfolder of my exe.
System.AppDomain NewAppDomain = System.AppDomain.CreateDomain("NewApplicationDomain");
Assembly a = NewAppDomain.Load(AssemblyName.GetAssemblyName(Path.Combine(_path, "MyAppName.exe")));
GetAssemblyName gets a valid name, but the Load method cannot find it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Have you tried using CreateInstance() instead?
Does this help?[^]
From msdn: The Load method of the System..::.AppDomain class can load assemblies, but is primarily used for COM interoperability. It should not be used to load assemblies into an application domain other than the application domain from which it is called.
Simon
|
|
|
|
|
Yeah, I tried that first. I couldn't make that work, either, for my exe which is in a different location.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How about using a Settings class? Project -> Add New Item -> General -> Settings File. I think the settings are saved in a file so you could check the current version and compare against the version in the settings file.
|
|
|
|
|
There are three exes here. The updater, the installed copy of my app, and a new copy of my app. The updater needs to read the version of the other two exes.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Okay I see. But I think my idea would work. The Updater has a settings file which contains the current version of the installed app. It checks the new version and if they're not equal, do an update.
|
|
|
|
|
I'm getting this in a WinForms project (in a multiple project solution), and can't for the life of me figure out why:
Error - Program 'myapplication.exe' does not contain a static 'Main' method suitable for an entry point myapplication
I verified that the program.cs file was there, and even created a new winforms app to verify that a) the contents of both program.cs files were the same,, and b) the new winforms app would compile (the new app does, the old one doesn't).
I have no idea why I'm getting this error.
EDIT: This only happens when I compile the solution. If I compile the project by itself, it's fine.
"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
modified on Wednesday, April 23, 2008 7:01 AM
|
|
|
|
|
Um... at risk of inviting your wrath, is there a static void main or a form selected as the entry point in the properties ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ummm, never mind - it was stupid programmer tricks (I was looking at the wrong sub-project).
"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 all, i want use Active Accessibility 2.0 methods in c#.net
how can i use it?
|
|
|
|
|
hi please tll me how to recieve all file names i selected and pressed enter to open with my application
i tried command$ and commandlineargs
but this gave me just one file name with every instance of application
i want a way to get them all together in just one time
i tried startupnextinstance
it is a very slow way
my email:slcompany@maktoob.com
please help.............
|
|
|
|
|
Check this link[^].
*jaans
|
|
|
|
|
The struct in my configuration file of my program is looks like this
public struct Example1
{
public int Vendor1;
public int Vendor2;
public int vendorcount;
}
I can access it by doing this
class MyModule
{
int output = Example.Vendor1;
output = Example.Vendor2;
}
I am planning to add a vendor3 without having to modify the code (MyModule), just the configuration file which contains the struct.
I tried using
for(int x=1;x<vendorcount;x++)>
{
string argument = "Vendor" + x;
Example.argument;
}
which, for obvious reasons, doesn't compile.
Is there a way around this? In which I can just add Vendor3 on the configuration file without having to add a code in MyModule class?
NOTE: The codes have been simplified, like the loading of configuration file, and accessing it
I'd appreciate any help you can give. Thanks
|
|
|
|
|
Have you heard about arrays?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
yes, but how will I implement it by not touching any of the MyModule code? I only want to add to the configuration file, so each time I add a vendor I don't have to change the code
Can you please provide a code so that I'll know if what you're suggesting is feasible on my part?
|
|
|
|
|
Simply set the number of vendors in you configuration file and then create an array of vendors with the required size at runtime.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Is this how you're suggesting it?
public struct Example1
{
public int Vendor1;
public int Vendor2;
public int vendorcount =2;
}
class MyModule
{
int[] newint = new int[vendorcount];
for(int x=1; x<vendorcount;x++)>
{
newint[x] = Exmaple1.Vendor1; ,--- (PROBLEM) how to point to Vendor2, vendor 3
}
}
how will be able to iterate through Vendor1 to Vendor2 (to vendor3 and so forth)? If I do this I'll have to change code on the MyModule class. I need to avoid having to change the code each time I add a new vendor
|
|
|
|
|
Nope.
I mean something similar to
class Example
{
public Example(int count){ vendor = new Vendor[count];}
public Vendor[] vendor;
};
class Program
{
public static void Main()
{
Example example = new Example(vendorCount);
}
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I think this might work. Thanks!
|
|
|
|
|
Hi,
Any clean idea on how to load a tree-like structure "eg. nested folders" into a treeview control?? I know I have to use recursion but I dont have the guts to do it
Please, shed some light on me if you have a previous experience in such problem.
Thanks guys!
To define recursion, we must first define recursion!
(\ /)
(O.o)
(><)
|
|
|
|