C# 保存任何文件到数据库,从数据库导出文件 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.IO; namespace myFil
C# 保存文件到数据库字段 attach new BusAttach ; FileInfo fi new FileInfo txtAttach Text Trim ; attach Fix fi Extension Substring 1 ToLower Trim ; FileStream fs fi OpenRead ; byte[] bytes new byte[fs Length]; fs Read bytes 0 Convert ToInt32 fs Length ; fs Close