Making API call every 5 seconds in C#
I'm trying to develop a mobile app on Xamarin Forms platform.I'm getting data from API.API call only happened once only when the application is opened. I'm Listing livescores between teams in a ListView . For example the minutes of the match 25 for now.I'm waiting 2 minutes and nothing changed. The minute is the same on my ListView.When I close and open the app again minute is changing.I just want to make call every 5 second to refresh the data without close the application.
Here is my code.
public List<liveScoreData>liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
return result;
}
c# api xamarin call
add a comment |
I'm trying to develop a mobile app on Xamarin Forms platform.I'm getting data from API.API call only happened once only when the application is opened. I'm Listing livescores between teams in a ListView . For example the minutes of the match 25 for now.I'm waiting 2 minutes and nothing changed. The minute is the same on my ListView.When I close and open the app again minute is changing.I just want to make call every 5 second to refresh the data without close the application.
Here is my code.
public List<liveScoreData>liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
return result;
}
c# api xamarin call
1
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49
add a comment |
I'm trying to develop a mobile app on Xamarin Forms platform.I'm getting data from API.API call only happened once only when the application is opened. I'm Listing livescores between teams in a ListView . For example the minutes of the match 25 for now.I'm waiting 2 minutes and nothing changed. The minute is the same on my ListView.When I close and open the app again minute is changing.I just want to make call every 5 second to refresh the data without close the application.
Here is my code.
public List<liveScoreData>liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
return result;
}
c# api xamarin call
I'm trying to develop a mobile app on Xamarin Forms platform.I'm getting data from API.API call only happened once only when the application is opened. I'm Listing livescores between teams in a ListView . For example the minutes of the match 25 for now.I'm waiting 2 minutes and nothing changed. The minute is the same on my ListView.When I close and open the app again minute is changing.I just want to make call every 5 second to refresh the data without close the application.
Here is my code.
public List<liveScoreData>liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
return result;
}
c# api xamarin call
c# api xamarin call
edited Nov 19 '18 at 12:46
Sir Rufo
14.3k22757
14.3k22757
asked Nov 19 '18 at 11:54
İsmail Çapkınİsmail Çapkın
165
165
1
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49
add a comment |
1
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49
1
1
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49
add a comment |
2 Answers
2
active
oldest
votes
What you can do is implement my special PollingTimer.cs class:
using System;
using System.Threading;
using Xamarin.Forms;
namespace AppNamespace.Helpers
{
/// <summary>
/// This timer is used to poll the middleware for new information.
/// </summary>
public class PollingTimer
{
private readonly TimeSpan timespan;
private readonly Action callback;
private CancellationTokenSource cancellation;
/// <summary>
/// Initializes a new instance of the <see cref="T:CryptoTracker.Helpers.PollingTimer"/> class.
/// </summary>
/// <param name="timespan">The amount of time between each call</param>
/// <param name="callback">The callback procedure.</param>
public PollingTimer(TimeSpan timespan, Action callback)
{
this.timespan = timespan;
this.callback = callback;
this.cancellation = new CancellationTokenSource();
}
/// <summary>
/// Starts the timer.
/// </summary>
public void Start()
{
CancellationTokenSource cts = this.cancellation; // safe copy
Device.StartTimer(this.timespan,
() => {
if (cts.IsCancellationRequested) return false;
this.callback.Invoke();
return true; // or true for periodic behavior
});
}
/// <summary>
/// Stops the timer.
/// </summary>
public void Stop()
{
Interlocked.Exchange(ref this.cancellation, new CancellationTokenSource()).Cancel();
}
}
}
Then what you can do following that is in your page that you want to make a call every 5 seconds from, in the constructor at the end of it you can write this line of code:
timer = new PollingTimer(TimeSpan.FromSeconds(5), liveScore);
This will run your method every 5 seconds. To make your method work with the pollingtimer you must edit your method to a void and return the value to a global variable like so:
//Make a global variable for your method to access
List<liveScoreData> globalLiveScore = new List<liveScoreData>();
public void liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
globalLiveScore = result;
}
Then from there you can check your live score data in other methods. Then in your OnAppearing method you can run
timer.Start();
and in your OnDisappearing method you can run
timer.Stop();
have a play with it and see if you can put it in better places for optimal performance etc.
You lost my upvote here:...you must edit your method to a void and return the value to a global variable...
. You could improve yourPollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.
– Jamiec
Nov 19 '18 at 12:51
add a comment |
You could use the System.Threading.Timer
object
and simply initialize it like this
`System.Threading.Timer myTimer = new System.Threading.Timer((e) =>
{
liveScore(); //your function call
}, null,
TimeSpan.FromSeconds(0), //start immediately
TimeSpan.FromSeconds(5)); //execute every 5 secs`
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374096%2fmaking-api-call-every-5-seconds-in-c-sharp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you can do is implement my special PollingTimer.cs class:
using System;
using System.Threading;
using Xamarin.Forms;
namespace AppNamespace.Helpers
{
/// <summary>
/// This timer is used to poll the middleware for new information.
/// </summary>
public class PollingTimer
{
private readonly TimeSpan timespan;
private readonly Action callback;
private CancellationTokenSource cancellation;
/// <summary>
/// Initializes a new instance of the <see cref="T:CryptoTracker.Helpers.PollingTimer"/> class.
/// </summary>
/// <param name="timespan">The amount of time between each call</param>
/// <param name="callback">The callback procedure.</param>
public PollingTimer(TimeSpan timespan, Action callback)
{
this.timespan = timespan;
this.callback = callback;
this.cancellation = new CancellationTokenSource();
}
/// <summary>
/// Starts the timer.
/// </summary>
public void Start()
{
CancellationTokenSource cts = this.cancellation; // safe copy
Device.StartTimer(this.timespan,
() => {
if (cts.IsCancellationRequested) return false;
this.callback.Invoke();
return true; // or true for periodic behavior
});
}
/// <summary>
/// Stops the timer.
/// </summary>
public void Stop()
{
Interlocked.Exchange(ref this.cancellation, new CancellationTokenSource()).Cancel();
}
}
}
Then what you can do following that is in your page that you want to make a call every 5 seconds from, in the constructor at the end of it you can write this line of code:
timer = new PollingTimer(TimeSpan.FromSeconds(5), liveScore);
This will run your method every 5 seconds. To make your method work with the pollingtimer you must edit your method to a void and return the value to a global variable like so:
//Make a global variable for your method to access
List<liveScoreData> globalLiveScore = new List<liveScoreData>();
public void liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
globalLiveScore = result;
}
Then from there you can check your live score data in other methods. Then in your OnAppearing method you can run
timer.Start();
and in your OnDisappearing method you can run
timer.Stop();
have a play with it and see if you can put it in better places for optimal performance etc.
You lost my upvote here:...you must edit your method to a void and return the value to a global variable...
. You could improve yourPollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.
– Jamiec
Nov 19 '18 at 12:51
add a comment |
What you can do is implement my special PollingTimer.cs class:
using System;
using System.Threading;
using Xamarin.Forms;
namespace AppNamespace.Helpers
{
/// <summary>
/// This timer is used to poll the middleware for new information.
/// </summary>
public class PollingTimer
{
private readonly TimeSpan timespan;
private readonly Action callback;
private CancellationTokenSource cancellation;
/// <summary>
/// Initializes a new instance of the <see cref="T:CryptoTracker.Helpers.PollingTimer"/> class.
/// </summary>
/// <param name="timespan">The amount of time between each call</param>
/// <param name="callback">The callback procedure.</param>
public PollingTimer(TimeSpan timespan, Action callback)
{
this.timespan = timespan;
this.callback = callback;
this.cancellation = new CancellationTokenSource();
}
/// <summary>
/// Starts the timer.
/// </summary>
public void Start()
{
CancellationTokenSource cts = this.cancellation; // safe copy
Device.StartTimer(this.timespan,
() => {
if (cts.IsCancellationRequested) return false;
this.callback.Invoke();
return true; // or true for periodic behavior
});
}
/// <summary>
/// Stops the timer.
/// </summary>
public void Stop()
{
Interlocked.Exchange(ref this.cancellation, new CancellationTokenSource()).Cancel();
}
}
}
Then what you can do following that is in your page that you want to make a call every 5 seconds from, in the constructor at the end of it you can write this line of code:
timer = new PollingTimer(TimeSpan.FromSeconds(5), liveScore);
This will run your method every 5 seconds. To make your method work with the pollingtimer you must edit your method to a void and return the value to a global variable like so:
//Make a global variable for your method to access
List<liveScoreData> globalLiveScore = new List<liveScoreData>();
public void liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
globalLiveScore = result;
}
Then from there you can check your live score data in other methods. Then in your OnAppearing method you can run
timer.Start();
and in your OnDisappearing method you can run
timer.Stop();
have a play with it and see if you can put it in better places for optimal performance etc.
You lost my upvote here:...you must edit your method to a void and return the value to a global variable...
. You could improve yourPollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.
– Jamiec
Nov 19 '18 at 12:51
add a comment |
What you can do is implement my special PollingTimer.cs class:
using System;
using System.Threading;
using Xamarin.Forms;
namespace AppNamespace.Helpers
{
/// <summary>
/// This timer is used to poll the middleware for new information.
/// </summary>
public class PollingTimer
{
private readonly TimeSpan timespan;
private readonly Action callback;
private CancellationTokenSource cancellation;
/// <summary>
/// Initializes a new instance of the <see cref="T:CryptoTracker.Helpers.PollingTimer"/> class.
/// </summary>
/// <param name="timespan">The amount of time between each call</param>
/// <param name="callback">The callback procedure.</param>
public PollingTimer(TimeSpan timespan, Action callback)
{
this.timespan = timespan;
this.callback = callback;
this.cancellation = new CancellationTokenSource();
}
/// <summary>
/// Starts the timer.
/// </summary>
public void Start()
{
CancellationTokenSource cts = this.cancellation; // safe copy
Device.StartTimer(this.timespan,
() => {
if (cts.IsCancellationRequested) return false;
this.callback.Invoke();
return true; // or true for periodic behavior
});
}
/// <summary>
/// Stops the timer.
/// </summary>
public void Stop()
{
Interlocked.Exchange(ref this.cancellation, new CancellationTokenSource()).Cancel();
}
}
}
Then what you can do following that is in your page that you want to make a call every 5 seconds from, in the constructor at the end of it you can write this line of code:
timer = new PollingTimer(TimeSpan.FromSeconds(5), liveScore);
This will run your method every 5 seconds. To make your method work with the pollingtimer you must edit your method to a void and return the value to a global variable like so:
//Make a global variable for your method to access
List<liveScoreData> globalLiveScore = new List<liveScoreData>();
public void liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
globalLiveScore = result;
}
Then from there you can check your live score data in other methods. Then in your OnAppearing method you can run
timer.Start();
and in your OnDisappearing method you can run
timer.Stop();
have a play with it and see if you can put it in better places for optimal performance etc.
What you can do is implement my special PollingTimer.cs class:
using System;
using System.Threading;
using Xamarin.Forms;
namespace AppNamespace.Helpers
{
/// <summary>
/// This timer is used to poll the middleware for new information.
/// </summary>
public class PollingTimer
{
private readonly TimeSpan timespan;
private readonly Action callback;
private CancellationTokenSource cancellation;
/// <summary>
/// Initializes a new instance of the <see cref="T:CryptoTracker.Helpers.PollingTimer"/> class.
/// </summary>
/// <param name="timespan">The amount of time between each call</param>
/// <param name="callback">The callback procedure.</param>
public PollingTimer(TimeSpan timespan, Action callback)
{
this.timespan = timespan;
this.callback = callback;
this.cancellation = new CancellationTokenSource();
}
/// <summary>
/// Starts the timer.
/// </summary>
public void Start()
{
CancellationTokenSource cts = this.cancellation; // safe copy
Device.StartTimer(this.timespan,
() => {
if (cts.IsCancellationRequested) return false;
this.callback.Invoke();
return true; // or true for periodic behavior
});
}
/// <summary>
/// Stops the timer.
/// </summary>
public void Stop()
{
Interlocked.Exchange(ref this.cancellation, new CancellationTokenSource()).Cancel();
}
}
}
Then what you can do following that is in your page that you want to make a call every 5 seconds from, in the constructor at the end of it you can write this line of code:
timer = new PollingTimer(TimeSpan.FromSeconds(5), liveScore);
This will run your method every 5 seconds. To make your method work with the pollingtimer you must edit your method to a void and return the value to a global variable like so:
//Make a global variable for your method to access
List<liveScoreData> globalLiveScore = new List<liveScoreData>();
public void liveScore()
{
var result = new List<liveScoreData>();
try
{
Guid guidSifre = Guid.NewGuid();
string guid = guidSifre.ToString();
string result = CreateMD5forChecksum(guid);
using (var client = new WebClient())
{
var values = new NameValueCollection();
values["result"] = result;
values["guid"] = guid;
var response = client.UploadValues("http://abcd.com/admin/LiveScore", values);
var responseString = Encoding.Default.GetString(response);
var responseResult = JsonConvert.DeserializeObject(responseString);
result = JsonConvert.DeserializeObject<List<liveScoreData>>(responseResult.ToString());
Mehmet.liveScoreDataList = result;
}
}
catch (Exception ex)
{
var exc = ex;
}
globalLiveScore = result;
}
Then from there you can check your live score data in other methods. Then in your OnAppearing method you can run
timer.Start();
and in your OnDisappearing method you can run
timer.Stop();
have a play with it and see if you can put it in better places for optimal performance etc.
answered Nov 19 '18 at 12:32
James MallonJames Mallon
309114
309114
You lost my upvote here:...you must edit your method to a void and return the value to a global variable...
. You could improve yourPollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.
– Jamiec
Nov 19 '18 at 12:51
add a comment |
You lost my upvote here:...you must edit your method to a void and return the value to a global variable...
. You could improve yourPollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.
– Jamiec
Nov 19 '18 at 12:51
You lost my upvote here:
...you must edit your method to a void and return the value to a global variable...
. You could improve your PollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.– Jamiec
Nov 19 '18 at 12:51
You lost my upvote here:
...you must edit your method to a void and return the value to a global variable...
. You could improve your PollingTimer
hugely by making it generic, representing the return type of the thing its polling over, and supplying a method to call with the result each poll.– Jamiec
Nov 19 '18 at 12:51
add a comment |
You could use the System.Threading.Timer
object
and simply initialize it like this
`System.Threading.Timer myTimer = new System.Threading.Timer((e) =>
{
liveScore(); //your function call
}, null,
TimeSpan.FromSeconds(0), //start immediately
TimeSpan.FromSeconds(5)); //execute every 5 secs`
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
add a comment |
You could use the System.Threading.Timer
object
and simply initialize it like this
`System.Threading.Timer myTimer = new System.Threading.Timer((e) =>
{
liveScore(); //your function call
}, null,
TimeSpan.FromSeconds(0), //start immediately
TimeSpan.FromSeconds(5)); //execute every 5 secs`
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
add a comment |
You could use the System.Threading.Timer
object
and simply initialize it like this
`System.Threading.Timer myTimer = new System.Threading.Timer((e) =>
{
liveScore(); //your function call
}, null,
TimeSpan.FromSeconds(0), //start immediately
TimeSpan.FromSeconds(5)); //execute every 5 secs`
You could use the System.Threading.Timer
object
and simply initialize it like this
`System.Threading.Timer myTimer = new System.Threading.Timer((e) =>
{
liveScore(); //your function call
}, null,
TimeSpan.FromSeconds(0), //start immediately
TimeSpan.FromSeconds(5)); //execute every 5 secs`
answered Nov 19 '18 at 12:56
MadenisMadenis
13639
13639
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
add a comment |
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
Thank you for your answer but i tried it didnt work .
– İsmail Çapkın
Nov 21 '18 at 6:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374096%2fmaking-api-call-every-5-seconds-in-c-sharp%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Why do you get a string, deserialize to object, turn it back to a string, and then deserialize it again?
– Jamiec
Nov 19 '18 at 12:49