本文整理汇总了C#中System.Windows.Forms.FolderBrowserDialog.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# FolderBrowserDialog.ToString方法的具体用法?C# FolderBrowserDialog.ToString怎么用?C# FolderBrowserDialog.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.FolderBrowserDialog
的用法示例。
在下文中一共展示了FolderBrowserDialog.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addNewDirectoryToolStripMenuItem_Click
private void addNewDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
DialogResult result = fbd.ShowDialog();
string[] files = Directory.GetFiles(fbd.SelectedPath);
List<FileModel> dirFiles = new List<FileModel>();
for(int i = 0; i < files.Length; i++)
{
FileModel theFile = new FileModel();
theFile.Path = files[i].ToString();
theFile.Name = new FileInfo(files[i]).Name;
theFile.Size = new FileInfo(files[i]).Length;
dirFiles.Add(theFile);
}
StaticValues.self.Files.Add(new DirectoryModel(fbd.SelectedPath, fbd.ToString(), dirFiles));
}
示例2: at
/* a few people have been seeing the following:
Failures:
1) MonoTests.System.Windows.Forms.CommonDialogsTest.FolderBrowserDialogTest : System.ArgumentException : oldValue is the empty string.
at System.String.Replace (System.String oldValue, System.String newValue) [0x00054] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/corlib/System/String.cs:1285
at System.Windows.Forms.FolderBrowserDialog+FolderBrowserTreeView.SetSelectedPath (System.String path) [0x00061] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:460
at System.Windows.Forms.FolderBrowserDialog+FolderBrowserTreeView.set_SelectedPath (System.String value) [0x0000c] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:363
at (wrapper remoting-invoke-with-check) FolderBrowserTreeView:set_SelectedPath (string)
at System.Windows.Forms.FolderBrowserDialog.set_SelectedPath (System.String value) [0x0001a] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FolderBrowserDialog.cs:223
at (wrapper remoting-invoke-with-check) System.Windows.Forms.FolderBrowserDialog:set_SelectedPath (string)
at MonoTests.System.Windows.Forms.CommonDialogsTest.FolderBrowserDialogTest () [0x00094] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/CommonDialogsTest.cs:260
at <0x00000> <unknown method>
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[])
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00040] in /tmp/scratch/BUILD/mono-1.2.70507/mcs/class/corlib/System.Reflection/MonoMethod.cs:143
*/
public void FolderBrowserDialogTest ()
{
fbd = new FolderBrowserDialog ();
Assert.AreEqual ("", fbd.Description, "#83");
Assert.AreEqual (Environment.SpecialFolder.Desktop, fbd.RootFolder, "#84");
Assert.AreEqual ("", fbd.SelectedPath, "#85");
Assert.IsTrue (fbd.ShowNewFolderButton, "#86");
Assert.AreEqual ("System.Windows.Forms.FolderBrowserDialog", fbd.ToString (), "#87");
string current_path = Environment.CurrentDirectory;
fbd.SelectedPath = current_path;
Assert.AreEqual (current_path, fbd.SelectedPath, "#89");
}