How can I get the dictionary value by a key on a function?

My function code (and the command I try doesn’t work):

static void XML_Array(Dictionary<string, string> Data_Array)
{
    String xmlfile = Data_Array.TryGetValue("XML_File", out value);
}

My button code:

private void button2_Click(object sender, EventArgs e)
{
    Dictionary<string, string> Data_Array = new Dictionary<string, string>();
    Data_Array.Add("XML_File", "Settings.xml");

    XML_Array(Data_Array);
}

I want on the XML_Array function the variable to be:

string xmlfile = "Settings.xml":

11 Answers
11

Leave a Reply

Your email address will not be published. Required fields are marked *