danasegarane
Active member
- Joined
- Jun 14, 2006
- Messages
- 41
- Programming Experience
- Beginner
Hi all,
I am using Array List to store values.I am using this code.
Here I want to the Filename to be unique in the list.But this code allows the duplicate filename to be stored in the list.How can I restrict this
Dana
I am using Array List to store values.I am using this code.
VB.NET:
Public Class Recovery
Public nFilename As String
Public nLockedby As String
Public nActivityID As String
Public Sub New(ByVal nfilename As String, ByVal nLockedby As String, ByVal nActivityid As String)
MyBase.New()
Me.nFilename = nfilename
Me.nLockedby = nLockedby
Me.nActivityID = nActivityid
End Sub
End Class
Public Shared Function GetPreviousStatus() As Boolean
'Dim sTemparray As New ArrayList 'Initialized separtely
If sTemparray.Contains(New Recovery(sFilename, sLockedby, sActivityid)) = False Then
sTemparray.Add(New Recovery(sFilename, sLockedby, sActivityid))
End If
End Function
Here I want to the Filename to be unique in the list.But this code allows the duplicate filename to be stored in the list.How can I restrict this
Dana