Is it possible for a dictionary to have the same key more than once? I've looked around quite a bit and the answer seems to be YesNo. I'm reading in cc numbers from a csv file and adding them to a dictionary. Most posts that say no generally indicate that adding a key more than once throws an exception. This would have to be wrong because I haven't encountered this problem.
Basically I have this dictionary
Dim allCalls As New Dictionary(Of String, Array)
and I'm populating it like this
Dim Path As String = My.Application.Info.DirectoryPath & "\Calls.txt"
Dim reader As StreamReader = My.Computer.FileSystem.OpenTextFileReader(Path)
Dim parts() As String
Dim lines() As String = IO.File.ReadAllLines(Path)
Array.Sort(lines)
For x As Integer = 0 To lines.GetUpperBound(0)
parts = lines(x).Split(CChar(","))
Dim data(1) As String
data(0) = parts(2)
data(1) = parts(5)
allCalls.Add(parts(1), data)
Next
reader.Close()
This part is working just fine, but as far as if I'm overwriting my old data when I add the same key I couldn't tell you. However it seems counterintuitive to me that it wouldn't cause some sort of problem. Basically my goal is to be able to search this thing for a key and get all the array data back which I can't figure out how to do. I don't even really know if it is still in there so any help with how to work with these things would be great.