先添加button6,和folderBrowserDialog
private void button6_Click(object sender, EventArgs e)
{
folderBrowserDialog1.SelectedPath = @"d:\音乐\mp3\" //设置文件夹的初始目录
folderBrowserDialog1.ShowNewFolderButton = true //显示新建文件夹按钮
folderBrowserDialog1.Description = "请选择MP3文件的路径" //对话框的说明文字
folderBrowserDialog1.ShowDialog()//显示对话框
string path = folderBrowserDialog1.SelectedPath
/*if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
// 在此添加代码,选择的路径为 folderBrowserDialog1.SelectedPath
}//得到选中的文件夹的物理路径*/
string applicationaddress = Application.StartupPath
stream = new FileStream(applicationaddress + "配置文件.txt", FileMode.Create)
StreamWriter writer = new StreamWriter(stream)
writer.Write(path)
writer.Close()
stream.Close()
Private Sub Command1_Click()If File1.List(File1.ListIndex) <> "" Then
List1.AddItem File1.List(File1.ListIndex)
End If
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)