// Nanjing-3-17
/// <Summary>
/// Progress information processing delegate
/// </Summary>
/// <Param name = "CompletedStep" type = "int"> Number of completed steps </param>
/// <Param name = "TotalStep" type = "int"> total number of steps </param>
Public delegate void ProgressHandler (int CompletedStep, int TotalStep );
/// <Summary>
/// Set of common functions
/// </Summary>
Public class YYFCommon
{
/// <Summary>
/// A routine for sending data to a specified URL using the POST method. This function does not handle errors.
/// </Summary>
/// <Param name = "strURL"> URL string </param>
/// <Param name = "bytSend"> binary data to be sent </param>
/// <Param name = "SendProgress"> progress of data sending </param>
/// <Param name = "AcceptProgress"> progress when receiving data </param>
/// <Returns> received binary data </returns>
Public static byte [] HttpPostData (
String strURL,
Byte [] bytSend,
ProgressHandler SendProgress,
ProgressHandler AcceptProgress)
{
// Send data
System. Net. HttpWebRequest myReq = (System. Net. HttpWebRequest) System. Net. WebRequest. Create (strURL );
MyReq. Method = "POST ";
System. IO. Stream myStream = myReq. GetRequestStream ();
Int iCount = 0;
If (SendProgress! = Null)
SendProgress (0, bytSend. Length );
While (iCount <bytSend. Length)
{