RSS

Call PHP File in Silverlight

11 Apr

you want to call PHP file in silverlight from codebehind then use this code.in 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.”);
}
}

}

Advertisements
 
Leave a comment

Posted by on April 11, 2012 in Silverlight

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: