I don’t how to get list values
Hashtable hshTable = new Hashtable();
List<string> l= new List<string>();
l.Add("string1");
l.Add("string2");
hshTable.Add("1",l);
try
string temp= hshTable["1"][0];
error Cannot apply indexing with [] to an expression of type ‘object’
>Solution :
From the documentation and error message, Hashtable.Item[Object] returns object.
public virtual object? this[object key] { get; set; }
You should cast the value as List<string> type before getting the value by index.
string temp= ((List<string>)hshTable["1"])[0];