Reading XML From The Httplistener?

Mar 30, 2009

what am I missing here.. I'm using the MSDN example but I want toread the xml that is coming as part of the XML..

Public Sub AsynchronousListener(ByVal prefixes() As String)
' spin up listener
listener = New HttpListener()

[code].....

View 1 Replies


ADVERTISEMENT

HttpListener Does Not Work Too Well

Sep 19, 2009

I wrote a HttpListener console application just to test it. I have been able to get the Httplistener class to respond to request for the local host, but not for any other URL. Any ideas? All examples I have seen on the Web just parrot what's on MSDN but no one has actually said that they got it work for any other URL other than local host.

In my code, I will add a URL to listen to like:Prefixes.Add("http://junk1234:80/"It it registers just fine(no errors) but when I type in http://junk1234:80 in my browser, my application just sits there and does not respond.

This works just fine(+ is a wild card to listen to any URL):Prefixes.Add("http://+:8080/") Browser URL: Http://localhost:8080 But if I change the URL to Http://junk3333:8080, my Listener code does not see it even though it should see any URL on port 8080.

I am running on Vista Home Premium(.Net 3.5) but running my listener console app as a admin.

View 2 Replies

.net - HttpListener As A Windows Service?

Mar 28, 2011

I have an httpListener exe that is working great. What I need to do now is make it a service (I think) so that when the server is rebooted, this program will start automatically. I found a few tutorials for making services and I got one installed, but when I started it, it said it took to long to respond. I was thinking that might be because I have a while true loop going in the onStart method.

View 2 Replies

Allow HttpListener In 2005.net To Allow Outside Access?

Aug 14, 2009

How do i allow the HttpListener in vb2005.net to allow outside access?

For testing purposes i have set it up to use the same ports as my webserver uses so there are no firewall issues.

the prefixes are set up to take the localhost on port 80 the realm is unset AuthenticationSchemes = Net.AuthenticationSchemes.Anonymous

it works just fine locally on the machine, but cant be reached by web browser on any other machine on my network

View 1 Replies

Communicate With An HTTPLISTENER That Have Created?

Dec 28, 2011

I've got this code below that creates an HTTPLISTENER that is nicely waiting at listener.GetContext().How do I communicate with this from another VB app? I cannot seem to get WebRequest.Create to work with the URI that my HTTPLISTENER example is using. This line of code from a second app is not working:

Dim request As WebRequest = WebRequest.Create(prefixes(0))

Here is the code:

[Code]...

View 1 Replies

Communicate With An HTTPLISTENER That I Have Created?

Dec 28, 2011

I've got this code below that creates an HTTPLISTENER that is nicely waiting at listener.GetContext().[code]....

View 1 Replies

Reference Current Http Context When Using HttpListener?

Aug 6, 2011

When using ASP we can reference HttpContext.Current from anywhere in the code to get at the current http context.

I want to do something similar using HttpListener, so that I can access GET/POST data etc from anywhere in my code. Can I reference some global object for this, or do I need to explicitly pass the current HttpListenerContext object all through my code?

View 2 Replies

2005 Simulate A Web Browser's File Download Using Net.HttpListener?

Aug 8, 2009

In vb2005 how do you simulate a web browser's file download using Net.HttpListener?This current program functions somewhat like a webserver. how when a client from a web browser
asks for a file do i allow them to down load the file? currently the method will tell the browser that there is a file but it will fail after the client oks the file for download.

View 1 Replies

VS 2008 How To Stop Async Operation (httplistener/begingetcontext)

Dec 30, 2011

I've created an httplistener and I'm using the async method it has.Starts like this on a BUTTON click in my test app

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim prefixes() As String = {"http://*:8080/HttpListener/"}
StartRequests(prefixes)
End Sub

[code]....

This forces the callback to fire - for some reason that I don't quite understand and it gets this error...

Quote:

The I/O operation has been aborted because of either a thread exit or an application request at this line

Private Sub GetContextCallBack(ByVal result As IAsyncResult)
'Dim listener As HttpListener = CType(result.AsyncState, HttpListener)
Dim context As HttpListenerContext = m_listener.EndGetContext(result)

View 19 Replies

VS 2010 HTTPListener Of Large Memory Stream Vs File I/o

Feb 24, 2012

I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1. BACKEND1 will be running on a SERVER when this gets ready for production use. Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.

On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files. Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on. Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK? Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?

My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much. just looking for opinions. I guess ultimately I'll have to bench mark this myself in a production environment to get a real answer.

View 1 Replies

VS 2010 HTTPListener Of Large Memory Stream Versus File I/o?

Sep 28, 2010

I have a user interface app that allows you to drag/drop in files - and it turns them into HttpListener request POST's to another EXECUTABLE that I have running - let's call it BACKEND1.BACKEND1 will be running on a SERVER when this gets ready for production use.Lots and lots of users running the UI - all dragging in files - all getting POST'ed to BACKEND1 - with the file included as a memory stream in the POST. BACKEND1 responds to the UI with a "sequential" file number assigned to the file centrally on the server.

On the SERVER is also running another EXECUTABLE - let's call it BACKEND2. It's job is to work with the DRAG'd in files.Both BACKEND1 and BACKEND2 sit on the same SERVER. At the moment I am writing the memory stream to DISK in BACKEND1 - and POSTing the FILENAME to BACKEND2 for it to work on.Would it be better to not write the file in BACKEND1 but instead include it in the POST to BACKEND2 - where it can be written to DISK?

Is having LARGE HTTP REQUEST's a burden when sent between two EXECUTABLES on the same machine?My primary goal is to have a really available BACKEND1 talking the the UI instances running out in the world. I'm concerned that doing the file i/o in BACKEND1 is "expensive" - and I don't care about the performance of BACKEND2 as much.

View 2 Replies

Request Server Variables From Within A Simple HTTPListener Web Server?

Dec 27, 2010

I am trying to use an Asynchronous HTTPListener to create a simple web server in VB .Net (Not ASP) This will be run as a desktop application. My only goal is to be able to request Server Variables from the client. Is there any way to do this from within a HTTPListenerWebServer? I am using the code from the MSDN VB .Net Samples:

[Code]...

View 5 Replies

Reading, Then Using, Then Reading Text File?

Jan 2, 2010

I am working on a project in VB 2008 and need it to do this:Read first line from text file (using Openfile)Enter line into textbox on formDo some other codeThen Read second linefrom text fileEnter line into same text boxand loop until we have gone through text fileI am not sure how to read line by line from text file then enter it in textbox. I can open the Openfile and get the filename and everything, but I just am not sure how to read from it or enter that line into the textbox.Here is what I have, its not much but its a start:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim FileReader As StreamReader

[code]....

View 4 Replies

SyncLock / Multithreading - Child Thread Reading The Values Of _do At The Same Time As Another Child Thread Is Reading The Values

Nov 13, 2009

I have a dictionary object (let's call it _do) I am using to cache some values for use in a multi-threaded program. I have a single controlling parent thread, with a timer function _doTimer() which can kick off child threads with a new instance of class MyThreadObject in each. My parent thread has _do as a property and with each time _doTimer() gets called, it may or may not repopulate _do depending on cacheflag settings. I pass a reference to _do to each instance of MyThreadObject and those threads at some point read the values of _do but DO NOT write to it.

What I want is to ensure that the child threads do not try and read _do whilst the parent thread is writing to it. Same thing but very slightly different -> I also don't want the parent thread to write to _do whilst the child threads are reading from it. However there is no problem with 1 child thread reading the values of _do at the same time as another child thread is reading the values - so ideally I do not want each child thread to completely lock out read access, only locking out Write access.. The code is roughly like this:

[Code]....

View 3 Replies

Not Reading Next Row In DB?

Apr 18, 2011

Even though the row is there its not allowing me to read the next row. I thought this would have worked but obviously not.

Imports System.Data.OleDb
Public Class formalQuiz
Dim Questions As String

[Code].....

View 11 Replies

Reading .txt Into VB?

Nov 19, 2010

I've been working on this project that lets me read in file "scores.txt" This file has a student name then a grade. ie:

Scubastevie
56
superman
33

There is no limit to amount of data scores should be able to read.

I'm just trying to be able to read in both sets of data and then have it display this way:

Scubastevie 56
Superman 33

I know you use arrays and I have done some code. Here is what i'm trying. I don't want two arrays, just one.

Public Class Form1
Structure ExamGrades
Dim name As String

[]Code].....

View 7 Replies

XML Reading From URL?

Feb 14, 2010

I am trying to develop a tool for use with an online game which has XML files available online (not downloads, automatically updated XML website things). Sorry if I'm not too clear as I don't truly understand how they work or anything!Anyway, I am trying to make a vb.net program access the information stored in these online XML pages but am having some difficulty. For a start, I tried the vb.net's help files which didn't help a great deal (well done Microsoft) because of the lack of informative comments on each code sample. It merely said that the output would be this (didn't even say where this output would be.

Next I tried searching the web but although I found a few things, some on this site, most of them were questions where the person already had a good knowledge of XML usage so they didn't put many comments on their code.

View 1 Replies

.net - Reading .txt File?

Jul 30, 2011

I am using following code to read text from a .txt file. But I don't know how to perform search within file and how to read a specific line in the text file, based on search.

Dim vrDisplay = My.Computer.FileSystem.ReadAllText(CurDir() & "keys.txt")
MsgBox(vrDisplay)

For an example, if I want to read the line that contains the word "Start", how to do that?

View 3 Replies

.NET Reading The Filename?

Dec 8, 2010

I have a filename SBSA_UPLD_20101208 and I am interested in reading the Last date part which is 20101208. How can I do it?

View 1 Replies

HTML GET Reading XML?

Mar 30, 2012

I am using the following code to get an XML data from a website of mine:

Dim strUrl As String = "http://www.xxx.net/mobileApp/checker.asp"
Dim reader As XmlTextReader = New XmlTextReader(strUrl)
Do While (reader.Read())

[Code].....

View 2 Replies

Not Reading All XML File?

Jul 22, 2009

I have an XML file, shown below:

<?xml version="1.0" standalone="no"?>
<!--RISInsight server settings-->
<Configuration>

[Code].....

Is there a way that I can make it continue to read the XML file?

View 4 Replies

Not Reading Every Line In Csv?

Mar 16, 2012

I have this code and I have no idea why it's not working.

Using parser As New Microsoft.VisualBasic.FileIO.TextFieldParser("\server
etlogoncsvsstafflookup.csv")
parser.SetDelimiters(",")

[Code]....

I want it to read the left value in a csv, if it matches the username then the ADGroup sets to the right column (so we have staff name and then year group)

This code seems to be skipping lines though and not going through each one but I don't know why.

View 13 Replies

Reading A .CSV File?

Nov 13, 2009

I have a vb.net POS application which creates a CSV file (three actually) to store data for later import into a database. All is working well with that part. Details and what I would like to do now follows: A single row of data in one of these files looks like this:

11/4/2009 1:57:50 PM,fg5,1234,21.00,21,0,0,0,0,21.00,12345

There are 11, I will call them columns, in each row, with varying number of rows each day. I need to extract only the information in column 10 from each row and total these numbers. I could do this with a FileOpen(1, <fullpathtofilename>, OpenMode.Input) and an input(1,<variablename>(i)) for each row in a FOR loop. This seems to be cumbersome and a waste of resources especially when the file is very large. Is there a easier, shorter, better, faster (use your own expeditious adjective here) way of doing this? Is there a way to read only the 10th item in each row and for how ever many rows there are? Something like this maybe:

Dim i As Integer
Dim Total as Double
i = 0

[code]....

View 1 Replies

Reading A .url File?

Jan 12, 2010

I am making a browser in vb which can import IE favourites. Here is my code so far:

Dim favespath As String = Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
Dim info As New IO.DirectoryInfo(favespath)
For Each fi In info.GetFiles

[code]....

But my code returns a load of HTML instead of the target of the .url file.

View 6 Replies

Reading A CR2 File?

Jul 2, 2011

I am looking to right a vb application that will read a cr2 file (cr2 is a images raw file) I want to be able to read the file resize it, save as a jpg, and auto post to my facebook albums (I have the facebook part done)

Someone has posted before [URL]..

View 3 Replies

Reading A File Bug?

May 27, 2009

The way this file works is there is a null buffer, then a user check sum then a byte that gives you the user name letter count, then a byte for how many bytes to skip to the next user and a byte for which user file the user keeps their settings in.

the loop with the usersm variable in the IF statement sets up the whole file stream for extraction. However with almost the exact same code the else clause specifically the str.Read(xnl, 0, usn - 1) in the else code appears to be reading the very beginning of the file despite the position of the filestream being set earlier?

this is in vb2005

Private Sub readusersdata(ByVal userdatafile As String)
ListView1.BeginUpdate()
ListView1.Items.Clear()
Using snxl As IO.Stream = IO.File.Open(userdatafile, IO.FileMode.Open)

[code]....

View 1 Replies

Reading A File In .net?

Sep 4, 2009

how to read a text file character by character in VB.NET??

View 2 Replies

Reading A Txt File?

Apr 6, 2011

I'm trying to read a .txt file line by line, but Visual Studio doesn't like what im doing. Here's my code so far:

Private Sub LoadGenre()
Dim StrApplicationPath As String = Directory.GetCurrentDirectory() & ""
Dim inputStream As StreamReader = File.OpenText(StrApplicationPath & "myfile.txt")

[code]....

View 3 Replies

Reading A XML Document

Mar 30, 2010

I'm trying to read a XML file, but only certain values.So my XML file is built from the result of a SQL query.[code]The probelm is the loop starts with line 1, good start.But then it will go to line one again, then line 2, line 2 again and so on.When it hits line 5, the first value I need to pull, it then stops.And thats how it is written, so that makes sence.I need to loop through this document, grab the certain values I need, and move on.

View 9 Replies

Reading Attributes From XML?

Jun 2, 2009

How would I go about reading this xml file?

<Data>
<Login Username="d" Password="d"/>
<Application Name="1" Key="1" Owner="1"/>

[Code].....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved