|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
FileDialog (Clase)
Espacio de nombres: System.Windows.Forms
Ensamblado: System.Windows.Forms (en System.Windows.Forms.dll)
El tipo FileDialog expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() | AddExtension | |
![]() | AutoUpgradeEnabled | |
![]() | CanRaiseEvents | |
![]() | CheckFileExists | |
![]() | CheckPathExists | |
![]() | Container | |
![]() | CustomPlaces | |
![]() | DefaultExt | |
![]() | DereferenceLinks | |
![]() | DesignMode | |
![]() | Events | |
![]() | FileName | |
![]() | FileNames | |
![]() | Filter | |
![]() | FilterIndex | |
![]() | InitialDirectory | |
![]() | Instance | Infraestructura. |
![]() | Options | Infraestructura. |
![]() | RestoreDirectory | |
![]() | ShowHelp | |
![]() | Site | |
![]() | SupportMultiDottedExtensions | |
![]() | Tag | |
![]() | Title | |
![]() | ValidateNames |
| Nombre | Descripción | |
|---|---|---|
![]() | CreateObjRef | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() | GetService | |
![]() | GetType | |
![]() | HookProc | |
![]() | InitializeLifetimeService | |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | OnFileOk | |
![]() | OnHelpRequest | |
![]() | OwnerWndProc | |
![]() | Reset | |
![]() | RunDialog | Infraestructura. |
![]() | ShowDialog() | |
![]() | ShowDialog(IWin32Window) | |
![]() | ToString | Infraestructura. |
| Nombre | Descripción | |
|---|---|---|
![]() | Disposed | |
![]() | FileOk | |
![]() | HelpRequest |
Precaución |
|---|
Importante |
|---|
private void button1_Click(object sender, System.EventArgs e) { Stream myStream = null; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\" ; openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ; openFileDialog1.FilterIndex = 2 ; openFileDialog1.RestoreDirectory = true ; if(openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((myStream = openFileDialog1.OpenFile()) != null) { using (myStream) { // Insert code to read the stream here. } } } catch (Exception ex) { MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message); } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
