Tag Archives: call php file in silverlight with webclient

Call PHP File in Silverlight

you want to call PHP file in silverlight from codebehind then use this this code php file exist on live domain director and you access that file in silverlight with parameters


private void phpcall(int campaingid, int batchsize)
Uri uri = new Uri(“http://” + FileHost + “/autodialer/startdial.php?compaignid=” + campaingid + “&batchSize=” + batchsize + “&t=” + DateTime.Now.Millisecond.ToString());

WebClient downloader = new WebClient();
downloader.Encoding = System.Text.Encoding.UTF8;
downloader.DownloadStringCompleted += new DownloadStringCompletedEventHandler(downloader_DownloadStringCompleted);
downloader.DownloadStringAsync(uri, UriKind.Absolute);

void downloader_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
if (e.Error == null)
if (e.Result != null)

//string[] temp = e.Result.ToString().Split(‘,’);
//MessageBox.Show( Convert.ToString(temp[1])+ “testing123”);
MessageBox.Show(“Campaign start successfully.”);


Leave a comment

Posted by on April 11, 2012 in Silverlight


Tags: ,