Heyho Leute. Ich versuch seit ner Zeit einen Windows Updater aus Langeweile zu Programmieren.Leider hab ich das Problem wenn ich das Programm debugge bekomm ich in Visual Studio die Meldung:
Habe versucht das Programm mit Administrator zu öffnen bekomme aber die Meldung:
Achtung etwas länger;)
Mein Code:
Hab das von der Seite: Klick mich von einem VB Skript in ein VB Programm umzuschreiben.Vielleicht kann mir da jemand helfen..
Habe versucht das Programm mit Administrator zu öffnen bekomme aber die Meldung:
VB.NET-Quellcode
- Informationen über das Aufrufen von JIT-Debuggen
- anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.
- ************** Ausnahmetext **************
- System.IO.FileNotFoundException: Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)
- bei Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
- bei Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
- bei WindowsApplication3.Form1.Button1_Click(Object sender, EventArgs e) in c:\users\codex\documents\visual studio 2013\Projects\WindowsApplication3\WindowsApplication3\Form1.vb:Zeile 12.
- bei System.Windows.Forms.Control.OnClick(EventArgs e)
- bei System.Windows.Forms.Button.OnClick(EventArgs e)
- bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
- bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
- bei System.Windows.Forms.Control.WndProc(Message& m)
- bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
- bei System.Windows.Forms.Button.WndProc(Message& m)
- bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
- bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
- bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
- ************** Geladene Assemblys **************
- mscorlib
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll.
- ----------------------------------------
- WindowsApplication3
- Assembly-Version: 1.0.0.0.
- Win32-Version: 1.0.0.0.
- CodeBase: file:///C:/Users/CodeX/Documents/Visual Studio 2013/Projects/WindowsApplication3/WindowsApplication3/bin/Debug/WindowsApplication3.exe.
- ----------------------------------------
- Microsoft.VisualBasic
- Assembly-Version: 10.0.0.0.
- Win32-Version: 11.0.50938.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll.
- ----------------------------------------
- System
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll.
- ----------------------------------------
- System.Core
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll.
- ----------------------------------------
- System.Windows.Forms
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
- ----------------------------------------
- System.Drawing
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
- ----------------------------------------
- System.Runtime.Remoting
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.34108 built by: FX45W81RTMGDR.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll.
- ----------------------------------------
- mscorlib.resources
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_de_b77a5c561934e089/mscorlib.resources.dll.
- ----------------------------------------
- System.Windows.Forms.resources
- Assembly-Version: 4.0.0.0.
- Win32-Version: 4.0.30319.18408 built by: FX451RTMGREL.
- CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
- ----------------------------------------
- ************** JIT-Debuggen **************
- Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
- Konfigurationsdatei der Anwendung oder des Computers
- (machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
- Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.
- Zum Beispiel:
- <configuration>
- <system.windows.forms jitDebugging="true" />
- </configuration>
- Wenn das JIT-Debuggen aktiviert ist, werden alle Ausnahmefehler an den JIT-Debugger gesendet, der auf dem
- Computer registriert ist, und nicht in diesem Dialogfeld behandelt.
Mein Code:
VB.NET-Quellcode
- Dim UpdateSession = CreateObject("Microsoft.Update.Session")
- Dim UpdateServiceManager = CreateObject("Microsoft.Update.ServiceManager")
- Dim UpdateService = UpdateServiceManager.AddScanPackageService("Offline Sync Service", "c:\wsusscn2.cab")
- Dim UpdateSearcher = UpdateSession.CreateUpdateSearcher()
- TextBox1.Text = "Searching for Updates..." & vbCrLf
- UpdateSearcher.ServerSelection = 3
- UpdateSearcher.ServiceID = UpdateService.ServiceID
- Dim SearchResult = UpdateSearcher.Search("IsInstalled=0")
- Dim Updates = SearchResult.Updates
- If SearchResult.Updates.Count = 0 Then
- TextBox1.Text = TextBox1.Text & "Es sind keine Verfügbaren Updates"
- End If
- For I = 0 To SearchResult.Updates.Count - 1
- Dim update = SearchResult.Update.Item(I)
- TextBox1.Text = TextBox1.Text & I + 1 & "> " & update.Title
- Next
Hab das von der Seite: Klick mich von einem VB Skript in ein VB Programm umzuschreiben.Vielleicht kann mir da jemand helfen..