C#代码
// 南京千里独行 2005-3-17/// <summary>
/// 进度信息处理委托
/// </summary>
/// <param name="CompletedStep" type="int">已经完成的步骤数</param>
/// <param name="TotalStep" type="int">总的步骤数</param>
public delegate void ProgressHandler( int CompletedStep , int TotalStep );
/// <summary>
/// 通用函数集合
/// </summary>
public class YYFCommon
{
/// <summary>
/// 向指定URL使用POST方法发送数据的例程,本函数不进行错误处理
/// </summary>
/// <param name="strURL">URL字符串</param>
/// <param name="bytSend">要发送的二进制数据</param>
/// <param name="SendProgress">发送数据时的进度处理</param>
/// <param name="AcceptProgress">接受数据时的进度处理</param>
/// <returns>接受到的二进制数据</returns>
public static byte[] HttpPostData(
string strURL ,
byte[] bytSend ,
ProgressHandler SendProgress ,
ProgressHandler AcceptProgress )
{
// 发送数据
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 )
{
补充:asp.net教程,C语言