|
1. Don't use ALL CAPS.
2. Why do you want to use C#, of all things, for a driver?
3. Please be more specific with your questions.
|
|
|
|
|
I had already had a BHO in c# which is generated through
http://www.codeproject.com/KB/cs/Attach_BHO_with_C_.aspx?fid=447248&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=51&select=2421069
I had character mapping done in c# using delegates. The main thing is I want to get the position or tag element attributes ( name or id of that tag element) where cursor position is set on browser window. How can I get this?
|
|
|
|
|
If I understand you correctly, and I doubt it (considering the vagueness of it all), what you are making is not a driver. That would actually be good news, since that means whatever it is you're doing might actually be possible.
|
|
|
|
|
Hi,
I was faced with the situation where at runtime I needed to create a type that derives from an existing types overriding some of its properties.
I decided to use Reflection.Emit and uitilized ILDASM to help with the il code.
It seems simple enough to implement. I'm using .Net 3.5 and am unsure if there is a more uptodate way of doing this, does anyone know?
|
|
|
|
|
DavidRen23 wrote: runtime I needed to create a type that derives from an existing types overriding some of its properties.
Are you creating the type at run time or invoking already created type using reflection? If you are creating type, you need to compile it before invoking. Look at CSharpCodeProvider[^] class. This will be easier than Reflection.Emit , I guess.
|
|
|
|
|
Thanks for the quick response, the CSharpCodeProvider class is something I will definitely use in the future. As of now everything is set up to use Reflection.Emit, HOWEVER I'm having a problem now defining an overriden property in my derived type. I'm assuming that I only have to define the get method in my derived type because the property (virtual by the way) already exists in the base type?
The error I get when I create an instance of the derived type and try to access the property is
'((Property)(derivedType)).Property' threw an exception of type 'System.InvalidProgramException' string {System.InvalidProgramException}
Any ideas?
Thanks
David.
|
|
|
|
|
Try running peverify.exe over the emitted IL - that'll give you a more clear error message.
|
|
|
|
|
Dear ALL
now i made an App C# which it write an EXE to a certain Path and it lock this file , now i need the same app to run this EXE while its locked !! ??
How?? does any one have an idea?
thanks
bye
|
|
|
|
|
Adore C++ wrote: now i made an App C# which it write an EXE to a certain Path and it lock this file , now i need the same app to run this EXE while its locked !! ??
What do you mean by "locked"?
|
|
|
|
|
this what i mean ...........
FileStream fileStream = new FileStream ........
fileStream.WriteByte .......... some where in C:\.....
fileStream.Lock
this filestram is EXE and it now locked , no other process can read it , now i need to run such EXE ??
how can i do that??
thanks all
bye
|
|
|
|
|
How would you run something that can't be read?
I are troll
|
|
|
|
|
Just a guess, you have a shortcut to the exe in your debug folder and you cannot run the app from the shortcut as it is "locked" by VS which just completed a compile?
Closing VS will free up the file - why are you running from a shortcut?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Yes, multiple even
I are troll
|
|
|
|
|
Mohamed Ibrahim Omar wrote: is there any implemented Algoritm for MD5 developed in .net
Quick Look
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
|
Good Morning ALL
I have an Arralist for example
1
2
3
4
5
2
4
3
Now i need to Find Duplicates in this array list. how can i get the Duplicated
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
You can try with IndexOf( ) and Contains() Methods
I have done with Contains(),
ArrayList Al = new ArrayList();
ArrayList al2 = new ArrayList();
Al.Add(1);
Al.Add(2);
Al.Add(3);
Al.Add(4);
Al.Add(3);
Al.Add(2);
Al.Add(1);
foreach (int i in Al)
{
if (!al2.Contains(i))
{
al2.Add(i);
}
}
Console.WriteLine("Original List");
foreach (int i in Al)
{
Console.WriteLine(i.ToString());
}
Console.WriteLine("Array List With Out Duplicate");
foreach (int i in al2)
{
Console.WriteLine(i.ToString());
}
Hope this will help you
You can even try with implement with same ArrayList.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Good Day Abhijit
Am Sorry i replied so late, i had to Look at some other Fuctionalities. I see what you are doing on the code. This will solve my Problem
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Thank you very much for your Answer. i need the Duplicates Values i don't want to get rid of them i need them in a Arraylist
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
While I would use a List<t> rather than an ArrayList, the principle is the same.
1) sort your data.
2) foreach(...) loop to spot the duplicates.
allAlbums.Sort();
#region Logging
LogEvent(string.Format(" Removing Duplicates"),
VerboseType.Verbose);
#endregion
List<Album> deleteThese = new List<Album>();
Album last = new Album("? - ? 2099");
foreach (Album a in allAlbums) {
if (a.Name == last.Name) {
#region Logging
LogEvent(string.Format(" Marking \"{0}\"", a.ToString()),
VerboseType.TooMuchInformation);
#endregion
deleteThese.Add(a);
}
last = a;
}
foreach (Album a in deleteThese) {
allAlbums.Remove(a);
}
#region Logging
LogEvent(string.Format(" ...{0} duplicates removed", deleteThese.Count),
VerboseType.Verbose);
#endregion
|
|
|
|
|
Good afternoon OriginalGriff
Thank you for your Help. Your solution is great. i have what has been posted before. but i will still look into it
Thank you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
ArrayList is too old and try to avoid unless you are on .NET 1.1.
Method 1
list.Sort();
int i = 0;
while (i < list.Count - 1)
{
if ((int)list[i] == (int)list[i + 1])
list.RemoveAt(i);
else
++i;
} Method 2
ArrayList target = new ArrayList(list.ToArray().Distinct().ToArray()); This works only when you have System.Linq namespace imported.
If you use .NET 3.5, use HashSet(T) class. It will not allow duplicate entries to be created. For .NET 2.0 or later, use List(T) other than ArrayList .
|
|
|
|
|
Good Afternoon N a v a n e e t h
The Duplicates are Created Intentional. My Client changed the Requirement. i was displaying a something like this
Staff Cycle
=============
James |4
Andrew |3
James |2
James |12
James |33
Cole |23
Daniel |56
This was Displayed in a Grid, so my Client want those with same name Displayed as a String. Now i wanted to Loop on the Grid on client side and look for the "James's" that appears more than once and put them in Arraylist or HashSet(T) after that and Display it like this
Staff Cycle
==================
Andrew |3
James |4,2,12,33
Cole |23
Daniel |56
Those that appears once , can remain with their single Value.
Thank you for your Help
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
A good approach is to use a hash table of List<int>, indexed by strings.
For each staff name, if it's not in the hash table, add it with a new List<int> containing the single cycle number.
If the staff name IS in the hash table, just add the cycle number to the existing List<int> associated with the name. Then to display the result, for each name in the hash table, write the name following by every cycle number in the corresponding list.
This approach only requires one pass through the data, and doesn't require sorting. The running time is O(n).
|
|
|
|