Hola a todos
mi pregunta es la siguiente como puedo habri los Cuadros de dialogo abrir y guardar como y si me pueden decir como se manejas si es posible si no de eso me encargare yo
De antemano gracias
| |||
Cuadros de dialogo abrir y guardar como Hola a todos mi pregunta es la siguiente como puedo habri los Cuadros de dialogo abrir y guardar como y si me pueden decir como se manejas si es posible si no de eso me encargare yo De antemano gracias |
| ||||
En la ayuda puedes encontrar esto que preguntas. Para el OpenFileDialog: Cita: http://msdn.microsoft.com/library/sp...ClassTopic.asp[Visual Basic] Protected Sub button1_Click(sender As Object, e As System.EventArgs) Dim myStream As Stream Dim openFileDialog1 As New OpenFileDialog() openFileDialog1.InitialDirectory = "c:\" openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" openFileDialog1.FilterIndex = 2 openFileDialog1.RestoreDirectory = True If openFileDialog1.ShowDialog() = DialogResult.OK Then myStream = openFileDialog1.OpenFile() If Not (myStream Is Nothing) Then ' Insert code to read the stream here. myStream.Close() End If End If End Sub Para SaveDialog Cita: http://msdn.microsoft.com/library/sp...ClassTopic.asp[Visual Basic] Protected Sub button1_Click(sender As Object, e As System.EventArgs) Dim myStream As Stream Dim saveFileDialog1 As New SaveFileDialog() saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" saveFileDialog1.FilterIndex = 2 saveFileDialog1.RestoreDirectory = True If saveFileDialog1.ShowDialog() = DialogResult.OK Then myStream = saveFileDialog1.OpenFile() If Not (myStream Is Nothing) Then ' Code to write the stream goes here. myStream.Close() End If End If End Sub saludos! |
| |||
![]() gracias por tu respuesta De hecho ya habia encontrado los objetos que me mencinas sin embargo son objetos de la clase System.Window.Form y no los puedo implementar en aplicaciones asp si conoces alguna manera en que pueda hacerlo te lo agradeceria mucho Gracias por tu respuesta ![]() |
| ||||
Para ASP.Net: Ejemplo: Cita: [Visual Basic] <%@ Page Language="VB" AutoEventWireup="True" %> <html> <script runat="server"> Sub UploadBtn_Click(Sender as Object, e as EventArgs) ' Display information about posted file FileName.InnerHtml = MyFile.PostedFile.FileName MyContentType.InnerHtml = MyFile.PostedFile.ContentType ContentLength.InnerHtml = cStr(MyFile.PostedFile.ContentLength) FileDetails.Visible = True ' Save uploaded file to server MyFile.PostedFile.SaveAs("c:\Uploadedfiles\uploadf ile.txt") End Sub </script> <body> <form action="fileupload.aspx" method="post" enctype="multipart/form-data" runat="server"> <h1>ASP.NET File Upload Example</h1> Select File To Upload to Server: <input id="MyFile" type="file" runat="server"> <br><br> <input type=submit value="Upload!" OnServerclick="UploadBtn_Click" runat="server"> <br><br><br> <div id="FileDetails" Visible=false runat="server"> FileName: <span id="FileName" runat="server"/> <br> ContentType: <span id="MyContentType" runat="server"/> <br> ContentLength: <span id="ContentLength" runat="server"/>bytes <br> </div> </form> </body> </html> Fuente: http://msdn.microsoft.com/library/sp...ileControl.asp saludos! |