昨天发帖做了一个发送卡发送本地文件的例程,见下贴
http://topic.csdn.net/u/20100427/11/a8e71a24-fa93-41db-8a2d-14cc59d59400.html
今天想继续拿发送卡发送一些局域网中的数据流
protected void senddata()
{
string path = "D:\\test.t";
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
long mm = file.Length;
int intmm = (int)mm; //取得文件大小
BinaryReader binaryreader = new BinaryReader(file);
MemoryStream ms = new MemoryStream ();//新建存储为内存的流
byte[] buff = new byte[37600]; //定义一个指定大小的字节数组(37600 bytes)用作缓冲区,将文件流放到缓冲区里面,然后发送出去 s1 = true;
int count=0;
while (s1 && i<intmm)
{
int a = binaryreader.Read(buff, 0, 37600);
count+=a;
ms.Write(buff, 0, a);
bst_transmit(buff,...);//读完以后发送 }
}
string path = "D:\\test.t";
将上面获取本地磁盘文件改为获取局域网中的数据流
string path = http://192.168.0.1:8080
取http://192.168.0.1:8080的端口数据 并且这个数据流会连续不停的发送
同样的我取到这个数据 在通过我的发送卡发送出去 这该怎么实现 有人做过么?
http://topic.csdn.net/u/20100427/11/a8e71a24-fa93-41db-8a2d-14cc59d59400.html
今天想继续拿发送卡发送一些局域网中的数据流
protected void senddata()
{
string path = "D:\\test.t";
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
long mm = file.Length;
int intmm = (int)mm; //取得文件大小
BinaryReader binaryreader = new BinaryReader(file);
MemoryStream ms = new MemoryStream ();//新建存储为内存的流
byte[] buff = new byte[37600]; //定义一个指定大小的字节数组(37600 bytes)用作缓冲区,将文件流放到缓冲区里面,然后发送出去 s1 = true;
int count=0;
while (s1 && i<intmm)
{
int a = binaryreader.Read(buff, 0, 37600);
count+=a;
ms.Write(buff, 0, a);
bst_transmit(buff,...);//读完以后发送 }
}
string path = "D:\\test.t";
将上面获取本地磁盘文件改为获取局域网中的数据流
string path = http://192.168.0.1:8080
取http://192.168.0.1:8080的端口数据 并且这个数据流会连续不停的发送
同样的我取到这个数据 在通过我的发送卡发送出去 这该怎么实现 有人做过么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货