|
Hey,
When I use a Culture and a resourceManager but there is no resourcebundle for my culture? What does he do?
And can I automaticly let him determin which resourcebundle he has to take (for example get the country settings of windows XP and use these to set your culture? (Don't know but I think this can)
Thx!
|
|
|
|
|
Hi,
For pulling information about a dll, I have tried Assembly.Load("dll name"), it doesn't work and I understand that I need to pass a full name. My requirement doesn't provide the full name, only the name of the dll should be passed and I should get full name with version, culture inforamtion etc.
Can some one tell how to fetch the version, culture etc information when given a dll name which is there in GAC..
Thanks for your help.
Satya 
|
|
|
|
|
SatyaDY wrote: it doesn't work
What happens? Does it throw an exception? Does it silently do nothing? Crash your hard disk?
I think the method you want is Assembly.LoadFile().
Cheers,
Vıkram.
Déjà moo - The feeling that you've seen this bull before.
Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
Yes it throws exception..
Assembly LoadedAssembly = Assembly.LoadFile(@"c:\WINDOWS\assembly\mscorlib.dll");
Exception Occured: The system cannot find the file specified. (Exception from HR
ESULT: 0x80070002)
I tried both Load and LoadFile, getting the similar exception. Any clues?
Thanks
Satya
|
|
|
|
|
The issue that you have here is that there is no file "c:\WINDOWS\assembly\mscorlib.dll". If you go to the command line and type in dir c:\windows\assembly you will see that it lists directories. The version that you see in the Windows shell is a wrapper to make it convenient for managing GAC entries.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Yes, you are correct. Not aware of this point...
But how to find out the info about the dll which are in GAC, (only know the dll name)?
I am really struck here, Thanks for your help.
Satya
|
|
|
|
|
If you only know the DLL name, then you should use Assembly.Load(); Here's an example:
Assembly assem = Assembly.Load("mscorlib.dll");
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
It works only with mscorlib.dll, if you try with some other dlls it fails... I am trying to build an application which needs the full deatils of the dll and it uses this information to generate a binding file.
|
|
|
|
|
Well, the hack way to do this would be:
Assembly assem = Assembly.Load("mscorlib.dll");
if (assem != null)
{
string path = System.IO.Path.GetDirectoryName(assem.Location);
assem = Assembly.LoadFrom(System.IO.Path.Combine(path, "System.Xml.dll"));
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
In addition to what Pete said... why do you want to load that particular DLL? If you want to look at the contents of mscorlib.dll, I suggest you fire up wincv.exe. If you want to load any DLL, verify the path and use Assembly.LoadFile().
I think relative paths will work with Assembly.LoadFile(), but if it blows up, Path.GetFullPath() is your friend.
Cheers,
Vıkram.
Déjà moo - The feeling that you've seen this bull before.
Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
Assembly.Load loads an assembly which is in the same directory with your application's executable.
Try Assembly.LoadFile or Assembly.LoadFrom but then your application can only run in FullTrust for security reasons.
|
|
|
|
|
When using Microsoft Visual Studio .NET, are there symbols defined by default with which I can determine which .NET framework is being used for the compilation?
I'm writing a custom control that inherits System.Windows.Forms.PictureBox . I'd like to override the OnMouseHover event handler but obviously this would not compile when I use the control in a .NET Compact Framework sollution.
So I was hoping to embrace the override with the #if compiler directive - something like this:
#if FULLFRAMEWORK<br />
protected override void OnMouseHover(EventArgs e)<br />
{<br />
base.OnMouseHover(e);<br />
}<br />
#endif
However, there is obviously no such symbol as FULLFRAMEWORK and I would prefer not to have to define it in every one of my projects that use this control. Is there a symbol that is defined by default that I could use for this purpose?
|
|
|
|
|
Hi,
AFAIK there are no predefined symbols.
I usually define either NET11 or NET20 in my Visual projects to discern different
.NET versions...
|
|
|
|
|
Hi all,
iam new to .net,iam getting problem at parsing the file.My sample file contains key value pair data,and key value is seperated by space and field is seperated by line.This is the sample code:
1aDOCSTART_3 |DOCTYPE BILL|
GENEVAVERSION 5.0
BILLSTYLE 2
BILLTYPE 1|
BILLTEMPLATE 3|
BILLSEQ 1|
BILLVERSION 1|
ACCCURRENCYCODE GBP|
BILLLANGID 1|
BILLLANGNAME English (UK)|
BILLLANGLOCALE en_GB|
PAYMETHODID 4
FORMATREQ TEST014/0001|
COPYBILLNUM 0|
BILLPURPOSE 1
BILLPURPOSENAME Master Bill|
ADDRESS1 11 Richmond Road
ADDRESS4 London|
ZIPCODE SW1V 1QP
COUNTRY United Kingdom|
BSTARTACCFADDR |
ACCFADDR_1 11 Richmond Road|
ACCFADDR_2 London|
ACCFADDR_3 SW1V 1QP|
ACCFADDR_4 United Kingdom|
In above file GENEVAVERSION 5.0 is one key value field it is seperated by space and each fields are seperated by pipe symbol and each is in new line.
my problem is how to parse this file as xml.pls send me some sample code it is more helpful for me.
Thanks&Regards
RENU
|
|
|
|
|
DON345 wrote: my problem is how to parse this file as xml.pls
Do you want convert this file into xml file ?
You can't parse this fiel as xml . you need to first convert it into xml
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
hi sandeep
so first we have to seperate the key value pair.so how to seperate them .pls help me in this situation.
Thanks&Regards
RENU
|
|
|
|
|
HI Renu
What you want to do with the file ? Why are you writing the file in this format then ? You can read this file as txt only you have to develop logic for that
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi sandeep
actually i want split the each key value field from that onwards we can convert into any like xml or database.pls send me some sample code to store it as key values
Thanks&Regards
RENU
|
|
|
|
|
Renu
We can do that only you have to think about logic see the code below
<br />
StreamReader streamreader=File.OpenText(Server.MapPath("TextFile.txt"));<br />
while (!streamreader.EndOfStream)<br />
{<br />
string line= streamreader.ReadLine();<br />
string[] values= line.Split(' '); <br />
<br />
}<br />
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Also each line contains only one key value pair or more ? Why pipe then ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
pipe symbol is seperate the each key value pair
Thanks&Regards
RENU
|
|
|
|
|
You could use the StreamReader.ReadLine method to read the file line by line and the String.Split method allows you to split each line according to your needs. Take a look at the documentation of both methods to get examples.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Can anybody please help me with this question ?
Role Based Menu[^]
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
You must learn to exercise some patience. It is bad manners to repose a question shortly after you've posted the original, and yes I do count 17 hours as a short time. You have to understand that people on this site give their time freely, and that they help where they can.
You aren't paying for support, so while your problem may be mind bogglingly urgent to you, it might not even make my top 100 of things to do today. More importantly, help can come from any area of the world so the person who may be able to help you may be doing something else such as sleeping - as hard as it may be for you to believe, some of us do have lives outside the boards.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have a question regarding the collection designer.
I have written a class "MyCollection" with ICloneable interface.
public class MyCollection: ICloneable
{
int a1 = 1;
string a2 = "abc";
MyCollection() {}
MyCollection( int _a1 )
{
a1 = _a1;
}
MyCollection( int _a1, string _a2 )
{
a1 = _a1;
a2 = _a2;
}
public object Clone()
{
return new MyCollection(a1, a2);
}
}
and use it in a component "Component1". Inside the Component1, I designed 2 properties, P1 and P2, P1 type is SqlParameter[] and another one P2 type is MyCollection[].
private SqlParameter[] p1;
public SqlParameter[] P1
{
get { return p1; }
set { p1 = value; }
}
private MyCollection[] p2;
public MyCollection[] P2
{
get { return p2; }
set { p2 = value; }
}
When I added the component into my form, I can see P1 and P2 in the property grid. For the P1, I can add the new SqlParameter object without problem. But for the P2, I can add but nothing can be saved. After I reopen the designer, P2 is still null. When I can view the design code directly:
this.component11.P1 = new System.Data.SqlClient.SqlParameter[] {
new System.Data.SqlClient.SqlParameter("", System.Data.SqlDbType.NVarChar),
new System.Data.SqlClient.SqlParameter("", System.Data.SqlDbType.NVarChar, 45)};
The designer only create SqlParameter object for P1. But no code for P2.
I have coded the ICloneable interface. However, is there any I still missed in coding the MyCollection class? Any information are appreciate.
Kenneth.Cheng
|
|
|
|