當前位置:
首頁 >
C#之文件拖放
發布時間:2025/3/15
40
豆豆
private void Form1_DragEnter(object sender, DragEventArgs e)
??????? {
??????????? if (e.Data.GetDataPresent(DataFormats.FileDrop))
??????????? {
??????????????? string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
??????????????? for (int i = 0; i < files.Length; i++)
??????????????? {
??????????????????? listBox1.Items.Add(files[i]);
??????????????? }
??????????? }
??????? }
??????? {
??????????? if (e.Data.GetDataPresent(DataFormats.FileDrop))
??????????? {
??????????????? string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
??????????????? for (int i = 0; i < files.Length; i++)
??????????????? {
??????????????????? listBox1.Items.Add(files[i]);
??????????????? }
??????????? }
??????? }
總結
- 上一篇: 软件设计简要
- 下一篇: C#简单操作Excel