vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Erstellen von dynamischen Kontextmen?s - wann immer Sie sie brauchen!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Ein- und Umsteiger
Re: XML aus Web auslesen 
Autor: CueForce
Datum: 05.04.10 13:34

Hallo,

Ich habe es mal so versucht:
Dim wc As New WebClient()
        wc.Credentials = New NetworkCredential("admin", "xxxxxx")
        Dim xml As String = wc.DownloadString( _
          "http://xxxxxxxx:9090/admin.cgi?mode=viewxml")
        wc.Dispose()
 
        Dim XMLDoc As New XmlDocument()
        XMLDoc.LoadXml(xml)
        Dim Knoten As XmlNode
        Dim stream As XmlNodeList = XMLDoc.SelectNodes("/SHOUTCASTSERVER")
        For Each Knoten In stream
            Label1.Text = Knoten.InnerText("CURRENTLISTENERS")
        Next
Dazu noch folgendes in der app.config eingefügt:

<?xml version="1.0"?>
<configuration>
  <system.net>
    <settings>
      <httpWebRequest useUnsafeHeaderParsing="true" />
    </settings>
  </system.net>
</configuration>
allerdings folgendes Porblem:

System.Net.WebException wurde nicht behandelt.
Message="Der Remoteserver hat einen Fehler zurückgegeben: (404) Nicht gefunden."
Source="System"
StackTrace:
bei System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
bei System.Net.WebClient.DownloadString(Uri address)
bei System.Net.WebClient.DownloadString(String address)
bei Modi_ToolZ.streamstatus.Label1_Click(Object sender, EventArgs e) in C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2008\Projects\Modi ToolZ\Modi ToolZ\streamstatus.vb:Zeile 10.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.Label.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(ApplicationContext context)
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
bei Modi_ToolZ.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
bei System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
bei System.Activator.CreateInstance(ActivationContext activationContext)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:

Gruss Robin

Beitrag wurde zuletzt am 05.04.10 um 13:37:25 editiert.
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
XML aus Web auslesen4.698CueForce05.04.10 00:46
Re: XML aus Web auslesen4.029ModeratorRalfE05.04.10 09:42
Re: XML aus Web auslesen4.137CueForce05.04.10 13:34
Re: XML aus Web auslesen4.017ModeratorDaveS05.04.10 16:07
Re: XML aus Web auslesen3.909CueForce05.04.10 16:17
Re: XML aus Web auslesen4.011ModeratorDaveS05.04.10 17:21
Re: XML aus Web auslesen3.946CueForce05.04.10 17:26
Re: XML aus Web auslesen3.976ModeratorDaveS05.04.10 19:36
Re: XML aus Web auslesen4.013CueForce05.04.10 19:44
Re: XML aus Web auslesen4.034ModeratorDaveS05.04.10 21:05
Re: XML aus Web auslesen3.933CueForce05.04.10 22:54
Re: XML aus Web auslesen3.977ModeratorDaveS06.04.10 10:48
Re: XML aus Web auslesen4.105CueForce06.04.10 11:06
Re: XML aus Web auslesen3.972ModeratorDaveS06.04.10 11:34
Re: XML aus Web auslesen3.972CueForce06.04.10 11:38

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel