欢迎来到传世资源网!
加载中...
正在加载,请耐心等待...
本站为收藏、学习站,如有侵权,请联系管理员删除!

c# 大文件 断点续传 上传实例源码 (WCF版本)

介绍 评论 失效链接反馈

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Runtime.InteropServices;namespace FileUpLoadTestWeb{ public partial class FileUpload : System.Web.UI.Page { [DllImport("Iphlpapi.dll")] private static extern int SendARP(Int32 dest, Int32 host, ref Int64 mac, ref Int32 length); [DllImport("Ws2_32.dll")] private static extern Int32 inet_addr(string ip); protected void Page_Load(object sender, EventArgs e) { //string mac = GetClientMac(); Response.Redirect("BreakPointUpLoad.aspx?UserID=100&Param=path|子文件夹&MUC_Code=code&FriendKey=12&AttributeType=23"); } /// <summary> /// 读取客户端MAC地址 /// </summary> /// <returns></returns> private string GetClientMac() { string mac = string.Empty; try { string userip = Request.UserHostAddress; string strClientIP = Request.UserHostAddress.ToString().Trim(); Int32 ldest = inet_addr(strClientIP); //目的地的ip Int64 macinfo = new Int64(); Int32 len = 6; int res = SendARP(ldest, 0, ref macinfo, ref len); string mac_src = macinfo.ToString("X"); if (mac_src == "0") { //if (userip == "127.0.0.1") // Response.Write("正在访问Localhost!"); //else // Response.Write(userip); return mac; } while (mac_src.Length < 12) { mac_src = mac_src.Insert(0, "0"); } string mac_dest = ""; for (int i = 0; i < 11; i ) { if (0 == (i % 2)) { if (i == 10) { mac_dest = mac_dest.Insert(0, mac_src.Substring(i, 2)); } else { mac_dest = "-" mac_dest.Insert(0, mac_src.Substring(i, 2)); } } } mac = mac_dest; } catch { } return mac; } }}

 

下载声明:

本站资源均有第三方用户自行上传分享推荐,非本站自制,仅供玩家做交流学习之用!切勿用于商业用途!游戏作品版权归原作者享有,如有版权问题,请附带版权证明至邮件,本平台将应您的要求删除。
相关推荐:

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复