Click here to Skip to main content
16,017,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello everyone,

CSS
this is my web service http://www.newsquizapp.com/webservice/get_question

Parameter : 1. device_id 2. quiz_type

Method: post

i already retrieve device_id & quiz_type but my problem is how to send device_id & quiz_type so that the device id is store in web service.
Posted
Comments
Joel Ivory Johnson 18-Feb-14 11:17am    
You would need to provide more details on your needs. There are multiple methods available for storing the device ID which include saving it to a session state, saving it in a database, and so on. Can you tell more about what you plan on doing with the saved device ID?
rishiraj malvi 18-Feb-14 23:15pm    
thanks for the reply,
i want to store it on database because in my app, if user answer 2 question and close the app & if he/she again open the app,they don't get the questions which he/she answered because the device id is stored in db & i have another service which helps him to do that.

1 solution

i solved using this thread:-

Uri uri = new Uri("http://www.newsquizapp.com/webservice/get_question");
string data = "device_id=123&quiz_type=all";
WebClient wc = new WebClient();
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
wc.UploadStringAsync(uri, data);
wc.UploadStringCompleted += wc_UploadComplete;

public void wc_UploadComplete(object sender, UploadStringCompletedEventArgs e)
{
string result = e.Result.ToString();
MessageBox.Show(result);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900