最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
C#代码
时间:2022-07-02 11:12:32 编辑:袖梨 来源:一聚教程网
// 南京千里独行 2005-3-17
///
/// 进度信息处理委托
///
/// 已经完成的步骤数
/// 总的步骤数
public delegate void ProgressHandler( int CompletedStep , int TotalStep );
///
/// 通用函数集合
///
public class YYFCommon
{
///
/// 向指定URL使用POST方法发送数据的例程,本函数不进行错误处理
///
/// URL字符串
/// 要发送的二进制数据
/// 发送数据时的进度处理
/// 接受数据时的进度处理
///接受到的二进制数据
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 )
{
///
/// 进度信息处理委托
///
/// 已经完成的步骤数
/// 总的步骤数
public delegate void ProgressHandler( int CompletedStep , int TotalStep );
///
/// 通用函数集合
///
public class YYFCommon
{
///
/// 向指定URL使用POST方法发送数据的例程,本函数不进行错误处理
///
/// URL字符串
/// 要发送的二进制数据
/// 发送数据时的进度处理
/// 接受数据时的进度处理
///
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 )
{
相关文章
- 《弓箭传说2》新手玩法介绍 01-16
- 《地下城与勇士:起源》断桥烟雨多买多送活动内容一览 01-16
- 《差不多高手》醉拳龙技能特点分享 01-16
- 《鬼谷八荒》毕方尾羽解除限制道具推荐 01-16
- 《地下城与勇士:起源》阿拉德首次迎新春活动内容一览 01-16
- 《差不多高手》情圣技能特点分享 01-16