СÖì
Hi all~
I wrote an application on Pocket PC 2003 SE and .NET Compact Framework 2.0 (with SP1).
This application will consume a Web Service to download photo file and instant authentication.
The Pocket PC has a RFID reader for authentication.
But, when I execute this application at RFID reader readed data and authenticated by Web Service and show photo, it closed unexpectedly, and no any message.
Something for my Pocket PC Application:
- I read data from RFID reader via System.IO.Serial.SerialPort class.
- I keep the Web Service Proxy Reference in the Global.PocketService variable.
- Photo will be downloaded from Web Service using base64 string format, and restore to binary format at Pocket PC Application with the following code:
try
{
string imageStrData = null;
if (Global.CurrentMode == Global.Mode.Arrival)
{
this._parentTable = Global.PocketService.GetStudentParentList
(Global._currentAttendanceDataPackage.ProfileID).Tables[0];
imageStrData = Global.PocketService.GetStudentPhoto(Global._currentAttendanceDataPackage.ProfileID);
}
else
{
this._parentTable = Global.PocketService.GetStudentParentList
(Global._currentDeparturePackage.ProfileID).Tables[0];
imageStrData = Global.PocketService.GetStudentPhoto(Global._currentDeparturePackage.ProfileID);
}
this.cboParentList.DataSource = this._parentTable;
this.cboParentList.DisplayMember = "Name";
this.cboParentList.ValueMember = "ParentID";
if (imageStrData != null)
{
// load student photo.
byte[] data = Convert.FromBase64String(imageStrData);
MemoryStream ms = new MemoryStream();
ms.Write(data, 0, data.Length);
ms.Flush();
ms.Position = 0;
Bitmap bmp = new Bitmap(ms);
this.picStudent.Image = bmp;
ms.Close();
ms = null;
data = null;
}
GC.Collect();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
I can't get any error message and application terminated unexpectedly...
Please help me to troubleshoot this problem, or, let me know how to diagnostic the problem point.
Thanks a lot.