Καλημέρα, έχω να δηλώσω ότι γνωρίζω να κάνω εισαγωγή τισ βιβλιοθήκες που αφορούν τον internet explorer αλλά δεν μπορώ να άνοίξω ένα παράθυρο του internet explorer χρησιμοποιώντας την visual basic dot net.. κολλάω λιγάκι,
Σκοπός μου είναι να δημιουγήσω για προσωπική χρήση ένα είδος μενού στην επιφάνεια το οποίο θα ανοίγει διάφορες εφαρμογές π.χ internet, word, excel, powerpoint...
Αλλά για κάποιο περίεργο λόγο μου κόλλησε να ξεκινήσω με τον Internet Explorer
Άνοιγμα του Internet Explorer...
Συντονιστές: WebDev Moderators, Super-Moderators
-
- Δημοσιεύσεις: 67
- Εγγραφή: 22 Σεπ 2007 06:55
Άνοιγμα του Internet Explorer...
από την βοήθεια του MSDN
Example
[Visual Basic] The following example demonstrates how to start one of four processes (Word, Excel, Internet Explorer, or Notepad), depending on information passed to the procedure that describes a document. The example assigns information to an existing process object and starts the procedure.
[Visual Basic] StartProcess takes two parameters. The first parameter is the name of a document, meaning any file that has an open action associated with it (for example, MyDoc.doc or MyFile.txt). The second parameter is the document's extension (.doc, .txt, .htm., or .xls). Using the extension, the StartProcess procedure associates an application with the Process component's StartInfo property. Then, the document itself is passed as an argument with which the application is opened. In the case of Excel or Word, the document is opened in order to be printed. In the case of Notepad or Internet Explorer, the document is only loaded into the application's window.
[Visual Basic] The file name and arguments are the same as you would type into the Run dialog box of the Windows Start menu.
[Visual Basic]
Private Sub StartProcess(ByVal fileName As String, ByVal extension As String)
' Declare and instantiate a new process component.
Dim myproc As System.Diagnostics.Process
myproc = New System.Diagnostics.Process
' Do not receive an event when the process exits.
myproc.EnableRaisingEvents = False
' Use the extenstion to determine which application to open.
Select Case extension
Case "doc"
' This .doc file opens in Word.
myproc.StartInfo.FileName = "winword"
' Print the file.
myproc.StartInfo.Verb = "print"
Case "xls"
' This .xls file opens in Excel.
myproc.StartInfo.FileName = "excel"
' Print the file.
myproc.StartInfo.Verb = "print"
Case "htm"
' This .htm file opens in the browser.
myproc.StartInfo.FileName = "iexplore"
Case "txt"
' This .txt file opens in Notepad.
myproc.StartInfo.FileName = "notepad"
End Select
' Assign the document that the file should open.
myproc.StartInfo.Arguments = fileName
' Start the application, and assign it to the process component.
myproc.Start
End Sub
[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button in the upper-left corner of the page.
Example
[Visual Basic] The following example demonstrates how to start one of four processes (Word, Excel, Internet Explorer, or Notepad), depending on information passed to the procedure that describes a document. The example assigns information to an existing process object and starts the procedure.
[Visual Basic] StartProcess takes two parameters. The first parameter is the name of a document, meaning any file that has an open action associated with it (for example, MyDoc.doc or MyFile.txt). The second parameter is the document's extension (.doc, .txt, .htm., or .xls). Using the extension, the StartProcess procedure associates an application with the Process component's StartInfo property. Then, the document itself is passed as an argument with which the application is opened. In the case of Excel or Word, the document is opened in order to be printed. In the case of Notepad or Internet Explorer, the document is only loaded into the application's window.
[Visual Basic] The file name and arguments are the same as you would type into the Run dialog box of the Windows Start menu.
[Visual Basic]
Private Sub StartProcess(ByVal fileName As String, ByVal extension As String)
' Declare and instantiate a new process component.
Dim myproc As System.Diagnostics.Process
myproc = New System.Diagnostics.Process
' Do not receive an event when the process exits.
myproc.EnableRaisingEvents = False
' Use the extenstion to determine which application to open.
Select Case extension
Case "doc"
' This .doc file opens in Word.
myproc.StartInfo.FileName = "winword"
' Print the file.
myproc.StartInfo.Verb = "print"
Case "xls"
' This .xls file opens in Excel.
myproc.StartInfo.FileName = "excel"
' Print the file.
myproc.StartInfo.Verb = "print"
Case "htm"
' This .htm file opens in the browser.
myproc.StartInfo.FileName = "iexplore"
Case "txt"
' This .txt file opens in Notepad.
myproc.StartInfo.FileName = "notepad"
End Select
' Assign the document that the file should open.
myproc.StartInfo.Arguments = fileName
' Start the application, and assign it to the process component.
myproc.Start
End Sub
[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button in the upper-left corner of the page.
Μέλη σε σύνδεση
Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης