1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Linq; 7 using System.Text; 8 using System.Threading.Tasks; 9 using System.Windows.Forms;10 11 using System.IO;12 using System.Data.SqlClient;13 14 15 16 namespace 图片存取17 {18 public partial class 实例 : Form19 {20 public 实例()21 {22 InitializeComponent();23 }24 public static string str = "server=192.168.0.102;database=mysql;uid=sa;pwd=a123456";25 private void 实例_Load(object sender, EventArgs e)26 {27 28 }29 30 /// <summary>31 /// 32 /// </summary>33 /// <param name="path"></param>34 public static void InsertImg(string path)35 {36 37 byte[] bytes = File.ReadAllBytes(path);38 SqlConnection con = new SqlConnection(str);39 con.Open();40 SqlCommand cmd = new SqlCommand("insert i.........
C#与sql进行图片存取
点赞
收藏