fmsearchdrive.cs

来自「USBView的C#源码」· CS 代码 · 共 40 行

CS
40
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace USBView
{
    public partial class fmSearchDrive : Form
    {
        public fmSearchDrive()
        {
            InitializeComponent();
        }

        public string DriveLetter;

        private void fmSearchDrive_Load(object sender, EventArgs e)
        {
            DriveLetter = "";

            foreach (DriveInfo di in DriveInfo.GetDrives())
            {
                if (di.DriveType != DriveType.Network)
                {
                    comboBox1.Items.Add(di.Name.TrimEnd('\\'));
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DriveLetter = comboBox1.Text;
            this.Close();
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?