CDYNE Phone Notify! Application

From CDYNE Wiki
Jump to: navigation, search

Back to Phone Notify!

This is open source Freeware. Feel free to use it as you wish.

Contents

Screen Shot

CDYNENotifyScreenShot.JPG

Download Links

Executable Program. *
C# Source Code

* If the executable does not run, please download the .NET Framework 2.0 from Microsoft MSDN or from Windows Update.

Goal

By writing this tutorial we would like to achive two goals:

  • Provide detailed description about how to use a Web Service in a stand alone application.
  • Build "real world" user application that uses CDYNE's Phone Notify! Web Service.

By following these instructions, the reader should be able to build a completely functional application. CDYNE also provide complete source code as well as fully built application.

Requirements

We are going to use C-Sharp (C#) Programming Language as a language of our choice. We will use Visual Studio .NET 2005 as our development environment.

Upload Routine

This is a code example from this program on how to upload sound files:

void UploadFiles(string[] fileNames)
{
if (fileNames == null)
return;
 
splitContainer2.Enabled = false;
 
bool bSuccess = false;
PhoneNotify notify = new PhoneNotify();
 
foreach (string fileName in fileNames)
{
try
{
lblStatus.Text = "Uploading " + fileName;
byte[] ba = System.IO.File.ReadAllBytes(fileName);
UploadFileResponse response = notify.UploadSoundFile(ba, fileName.Substring(fileName.LastIndexOf("\\")), txtLicenseKey.Text.Trim());
if (response.UploadSuccessful == false)
{
lblStatus.Text = "Uploading for: " + fileName + " FAILED";
}
else
{
lblStatus.Text = "Uploading for: " + fileName + " SUCCEEDED";
bSuccess = true;
}
}
catch (Exception)
{
lblStatus.Text = "One or more file upload FAILED";
}
Application.DoEvents();
}
 
if (bSuccess)
FillSoundCmb();
 
splitContainer2.Enabled = true;
}

The important part of the code above is:

PhoneNotify notify = new PhoneNotify();
byte[] ba = System.IO.File.ReadAllBytes(fileName);
UploadFileResponse response = notify.UploadSoundFile(ba, fileName.Substring(fileName.LastIndexOf("\\")), txtLicenseKey.Text.Trim());

Those 3 lines will upload a wav file into your account under that license key.

Personal tools
Namespaces

Variants
Actions
Navigation
Tools

Trial Key