|
BINO VARGHESE wrote: the DLL in that website is corrupted my dear friend...so can u plz send me someother link..
awaiting reply..
Well, I just googled for the file name and found some sites...
|
|
|
|
|
can u send me if u get any free sites for the DDL...me too searched but itz all paid sites
|
|
|
|
|
|
thanx dude vl try using it....
|
|
|
|
|
I have an array of objects. Each object refers to an mp3 file as follows:
mp3file.Title
mp3file.Artst
mp3file.Album
mp3file.TrackNumber
My question is, how can I sort the array by a specific item of the object, eg. Sorted by Artist, sorted by Album etc.
Thnaks
|
|
|
|
|
Make a custom comparer for your class, and use that in a call to Array.Sort.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Thanks for the quick reply.
You say, 'Make a custom comparer for the class'. I'm fairly new to VB.net and don't quite understand what you mean. Please could you explain a little more.
Thanks again
|
|
|
|
|
Something like this. Say you want to sort by Artist name.
Make a function:
Function CompareArtist(ByVal Artist1 As String, ByVal Artist2 As String) As Boolean
IF (Artist1>Artist2) Then
Return True
Else
Return False
End IF
End Function
Then when you do your sort, have something like this:
If CompareArtist(mp3file(1).Artist,mp3file(2).Artist) Then
//Do you sorting here depending on the result of the compareartist function.
End If
You could make a seperate comparison function for each member of the object, or just 1 or 2 depending on the type's of the object's members (if they are all strings for example). I hope that makes some sense.
David
|
|
|
|
|
Thanks very much, this is the sort of thing I was after.
I guess you cant use array.sort on an array of objects. I though there was probably some syntax you could add into array.sort to specify which 'column' you wanted to sort by.
Anyway, the code you have given me David looks fine. Thanks
|
|
|
|
|
Create a class that implements the interface IComparer. The class needs to have a method named Compare that does the comparison of the properties you want to sort.
I usually don't program VB, but something like this:
Class MyObjectComparer Inherits IComparer
Public Function Compare(A as Object, B as Object)
Return String.Compare(DirectCast(A, MyClass).SomeProperty, DirectCast(B, MyClass).SomeProperty)
End Function
End Class
This you can use to sort your array of MyClass objects:
Dim comparer as new MyObjectComparer()<br />
Array.Sort(TheArray, comparer)
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
hi..
i need help with rounding decimals to nearest 10th.
e.g
$1.20,$1.21 & $1.22 rounded 1.20
$1.23,$1.24 rounded to $1.25
$1.26 , $1.27 rounded to $1.25
$1.28 , $1.29 rounded to $1.30
hope this above example is an idea of what i need.
thanks
Robbo
|
|
|
|
|
Multiply by 10, round it (integer rounding), and then divide by 10?
|
|
|
|
|
hi chandra
can you give me a quick sample source.
Robbo
|
|
|
|
|
|
Chand
an a sample like this. the end result always rounds down
e.g. dim num as decimal = 1.23
dim roundednum as integer
roundednum = math.round(num *10)/10
'result = 1.2 instead of 1.25
Robbo
|
|
|
|
|
But that is what you wanted, right? Round to nearest 10th?
Btw, my name is Chandra
|
|
|
|
|
i think my first message was right except i said 10th which gave a confusion.
basically i need decimal rounded down or up to nearest decimal
e.g 1.20 ,1.21,1.22 should be $1.20
1.23,1.24,1.25 should be $1.25
1.26,1.27 should be $1.25 (round down here)
1.27,1.28,1.29 should be $1.30
btw. i know your name is Chandra was just giving you a short nick thats all.
sorry if that offended you.
Robbo
|
|
|
|
|
My bad - I did not study the examples, just went by your statement
What you want is round to nearest 5 cents...
Ok, try this then:
x = round(x * 20) / 20
|
|
|
|
|
Thank you Chandra.. as soon as i posted my last msg .. YOU HAD MY FIX READY..
your a champ. thankyou so much champ..
just what i needed.
Robby
|
|
|
|
|
You are welcome
Glad I could help
|
|
|
|
|
Hi Folks
I enabled audit logging on a particual folder. The transactions happening on that folder will be logged in Security event logger. I want to generate an excel report with the details (User name, File Opened/Deleted/Created, DataTime).
Thanks in Advance
Regards
Hari
|
|
|
|
|
So what's the question? You haven't asked anything, other than implied your looking for permission to do this, in that case permission granted!
What part of this are you having a problem with?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave
I need help in reading Security log in .Net and generate an Excel report.
Excel report will have following columns
File Name | Date&Time | Action Performed | User
e.g.
D:\Temp\1.doc | 20-12-2006 07:10:10 AM | Updated | Hari
Thanks in advance
Regards
Hari
|
|
|
|
|
The question still stands. What part of this are you having a problem with??
Is it reading event logs? Writing to a .CSV file? Interpreting the Security events?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
I am unable to Interpreting the Security events?
Can you help me in how to Interpreting the Security events? and generate a CSV file. That CSV file should contain the log entries of only Audit folders.
E.g. if i enable audit logging on a folder in my machine "D:\Temp", then i want a report which should contain the information abt the activities performed in that folder like Creation of file,Deletion of file,Renaming a File and updating a file/Folder.
Format of the CSV/Excel file should be as follows
File | User | Date & Time | Action
D:\Temp\1.txt| Hari | 27-12-2006 | Deleted
Thanks in advance
Reghards
Hari
|
|
|
|