私はWindowsPhoneを初めて使用します。
に4つの値を格納していDictionary<string, object>
ます。エントリを確認すると、7つのエントリが表示され、3つはnullのキーと値です。
コード:
Dictionary<string, string> obj = new Dictionary<string, string>();
private void button1_Click(object sender, RoutedEventArgs e)
{
obj.Add("K2", "V2");
obj.Add("K3", "V3");
obj.Add("K4", "V4");
obj.Add("K5", "V5");
}
何か助けはありますか?
辞書を使い果たしたコード:
private void GetLoginCallback(IAsyncResult asynchronousResult)
{
try
{
Dictionary<string,object> Parameters = new Dictionary<string,object>();
/**httprequest for making asynchronous call**/
HttpWebRequest httpRequest = (HttpWebRequest)asynchronousResult.AsyncState;
/**response from the httprequest**/
HttpWebResponse httpresponse = (HttpWebResponse)httpRequest.EndGetResponse(asynchronousResult);
/**Reading the response as stream**/
Stream streamResponse = httpresponse.GetResponseStream();
using(StreamReader streamRead = new StreamReader(streamResponse))
{
var response = streamRead.ReadToEnd();
//Deployment.Current.Dispatcher.BeginInvoke(new Action(() =>
//{
if (response != null && httpresponse.StatusCode == HttpStatusCode.OK)
{
WebHeaderCollection headers = httpresponse.Headers;
/**getting Session_ID **/
string session_cookie = headers[DisplayMessage.Set_Cookie];
string sessionCookie = headers[DisplayMessage.Set_Cookie];
string[] values = sessionCookie.Split(DisplayMessage.Split_SemiCollen);
string[] jID = values[0].Split(DisplayMessage.Split_EqualTo);
jsessionId = jID[1];
/**storing Authentication parameters in dictionary**/
Parameters.Add("Username", "test4");
Parameters.Add("Password", "*****");
Parameters.Add("JSessionID", "FGBfdhhfuhuhhbh_Path");
Parameters.Add("SessionCookie","FGBfdhhfuhuhhbh_Path;dpk");
//}));
};
}
}
catch(Exception ex)
{
}
}