|
Eddymvp wrote: How can I decompile a C# executible file and see the source code?
With Lutz Roeder's Reflector[^]
NOTE: This will NOT give you the original source code. The compiler will make various optimisations to the code when it compiles it so the code that Reflector produces will be functionally equivalent but not the original.
|
|
|
|
|
I tried using that, but it doesn't give me the option to extract the class the create a new project.
|
|
|
|
|
Well... you didn't ask for that.
Do you really need a program to do that for you? You can just copy the code and paste it into a project that you create yourself.
---
single minded; short sighted; long gone;
|
|
|
|
|
There are addins for that, look for FileDisassembler.
|
|
|
|
|
Hello,
Let's say I have the following variables:
string var1 = "5567 87865 4432 54535 6678 4435";
string var2 = "667 332 32 555677 4465 44444444";
string part_of_var1 = "4432 54535";
string xxx = String.Empty;
I want to have in xxx: 32 555677!
Notice that part_of_var1 contains the third and fourth parts of var1. I want to have 32 555677 in xxx var because it is the third and fourth parts of var2.
I hope it's clear!
Please help. Your help would be much appreciated.
|
|
|
|
|
I'm not really sure what you are trying to achieve here, but you can achieve what you want to do quite easily (and without hardcoding the result):
string[] splitter = var2.Split(' ');
if (splitter != null && splitter.Length > 4)
{
xxx = string.Format("{0} {1}", splitter[2], splitter[3]);
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Thank you very much. The problem is I don't know the position at design or runtime. The only clue I have is the value of part_of_var1 variable.
So maybe I have to count spaces?
Thank again.
|
|
|
|
|
I think this will come close to what you want:
public void test() {
string var1 = "5567 87865 4432 54535 6678 4435";
string var2 = "667 332 32 555677 4465 44444444";
string part_of_var1 = "4432 54535";
string xxx=getPartsOfVar2(var1, var2, part_of_var1, ' ');
Console.WriteLine(xxx);
|
public string getPartsOfVar2(string var1, string var2, string part_of_var1, char sep) {
string[] arr1=var1.Split(sep);
string[] arr2=var2.Split(sep);
if (arr1.Length!=arr2.Length) throw some exception;
string[] arr1p=part_of_var1.Split(sep);
int partCount=arr1p.Length;
string[] arr2p=new string[partCount];
for(int i=0; i<partCount; i++) {
string part=arr1p[i];
int index=arr1.IndexOf(part);
if (index<0) throw some exception;
arr2p[i]=arr2[index];
}
return String.Join(sep, arr2p);
}
|
|
|
|
|
Hello Luc,
I'm getting the following errors when I'm trying to compile the code:
Error 1 No overload for method 'IndexOf' takes '1' arguments ccc.cs 626 19 ccc
Error 2 The best overloaded method match for 'string.Join(string, string[])' has some invalid arguments ccc.cs 630 12 ccc
Error 3 Argument '1': cannot convert from 'char' to 'string' ccc.cs 630 24 ccc
|
|
|
|
|
I did not compile/run so you have to check the documentation and make small adaptations.
As an example Array.IndexOf seems to be a static method with two args, so study and
correct it.
|
|
|
|
|
Split var1 by part_of_var1, so that you get an array with two items. Count the number of spaces in each of them and put in s1 and s2. Split var2 by space, then join that array again except the first s1 items and the last s2 items.
Not dizzy yet...
---
single minded; short sighted; long gone;
|
|
|
|
|
Can you please give me some code, I'm really a beginner in C#.
|
|
|
|
|
I figured out exactly how to do it for you. Can't you at least make an attempt at writing the code yourself?
---
single minded; short sighted; long gone;
|
|
|
|
|
Ok sorry
I did what you said except:
"then join that array again except the first s1 items and the last s2 items."
How can I do that?
Thanks a lot.
|
|
|
|
|
I'm still trying but I can't figure out how to "join that array again except the first s1 items and the last s2 items."
|
|
|
|
|
Use the String.Join method, like this:
string result = String.Join(" ", arrayOfStrings, s1, arrayOfStrings.Length - s1 - s2)
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Looking at MSDN overview of collections, I can not find anything about set.
How would you represent an unordered set of references in C#? The set will hold up to about million of references and I need fast Contains, Insert/Remove operations. I don't need intersection, union...
|
|
|
|
|
What type of references?
File references, dll references, .NET assemly references, memory references?
Regards,
Thomas Stockwell
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.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi,
there recently has been a CP article on sets (with set operations, which you dont want).
What you need is not really a set, it could be any kind of collection.
So try ArrayList (all .NET versions) or a List (if .NET >= 2.0)
|
|
|
|
|
I managed to put something together based on KeyedCollection. It's not perfect, but it get the job done:
<code>
public class Set<T> : KeyedCollection<T, T>
{
public Set()
: base( EqualityComparer<T>.Default, -1 )
{
}
public Set( IEqualityComparer<T> comparer )
: base( comparer, -1 )
{
}
public new void Add( T item )
{
if ( !this.Contains(item ) )
base.Add( item );
}
public void AddRange( IEnumerable<T> enumerable )
{
foreach ( T item in enumerable )
this.Add( item );
}
override protected T GetKeyForItem( T item )
{
return item;
}
}
</code>
|
|
|
|
|
I tried using images in my listview, but it doesn't work o_O
i added an imagelist, made it my listview's imagelist but i still don't see the image when i add an item (yes, i do pick an image index).
any solutions?
|
|
|
|
|
Have you set up Application.EnableVisualStyles by any chance? Try placing Application.DoEvents() immediately after it.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
My question is What is the exact syntax to connect? i mean its our first tym using IBM DB2 server and its kinda hard.
We've connected the DB2 to C# by the components but the exact syntax for opening a connection or closing or inserting an item to the table is a real question...thank you very much...
|
|
|
|
|
Hello, I'm new to attributes. Attributes seem to solve a problem I have with my data representation. However, how are attributes stored in a database?
Specifically, I'm using VS'03 to build a typed data schema, wherein I create and populate some elements. I can use the SqlDataAdapter to load/retrieve from the dB, no problem. Now, I add attributes to the schema, how do I get them into the dB and what is the representation?
Thanks.
NYC Traveler
|
|
|
|