ReadToEnd Hangs On Redirect?

Jun 7, 2011

I am using VB in VS 2008. I am tring to call an external process and redirect the input, and pars the output back to my code.I started with the useal

Dim myProcess As New Process()
Dim StringFromProcess As String
myProcess.StartInfo.WorkingDirectory = (path & "in")

[code]....

but I will need 4 of them to get to the data and it seem to me its messy coding. Is there a way to get ReadToEnd to work when reading data over TCPIP? Or perhaps a different/better way to read back from my process?

View 3 Replies


ADVERTISEMENT

VS 2010 ReadToEnd And String?

Jan 26, 2011

I have a text file 36Kb that i would like to open and manipulate. To do this I use:

FileContents = objReader.ReadToEnd()However when I write the manipulated output like so:

objReader = New StreamWriter(FilePath)
objReader.Write(ModifiedContents)

the output file stops mid sentence and is only 32Kb in size.

View 4 Replies

.Net BackgroundWorker Hangs Up?

Mar 21, 2011

I have limited experience in VB.net and have become stuck. I have tried to search for answers on other threads without success.I have an application that displays real time data.Queries are made to a MySQL database on another PC over the internet every 10 seconds to gather the most recent data.I have done the query within a BackgroundWorker so that the GUI is still responsive while the query is answered.What I've done works great for several hours or maybe for a couple of days but then the DoWork task appears to hang.

The code I'm using is to run the background worker is:

vb
If Not(backgroundWorker1.IsBusy) Then Me.backgroundWorker1.RunWorkerAsync() End If

The backgroundWorker runs just once and there's very little code in the DoWork routine:

vb
Private Sub backgroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles backgroundWorker1.DoWork rs = New

[code].....

Is there anyway I can set up a timeout on the maximum allowed time that the DoWork task can be active for? And if so how would I then go on to stop the backgroundWorker?I understand that CancelAsync isn't going to help as my DoWork task is not repeating as it runs once only, then stops and 10 secs later I run it again.

View 1 Replies

IDE :: Build Hangs In VB

Dec 6, 2011

When i try to build a project, vb hangs and displays this message in the notification area Microsoft Visual Basic Express 2010 is Busy. i have to end up using Task Manager to end the process i have been using VB Express for about a year and have never had this problem. i have tried to re-install VB 2010 express, no joy.

View 1 Replies

OpenFileDialog Hangs Used Once?

May 26, 2012

ApplicationName has stopped workingA problem caused the program to stop working correctly.Windows will close the program and notify you if a solution is available.

Here is my code:
Private Sub OpenFile()
Dim OpenFileDialog As New OpenFileDialog

[code].....

View 10 Replies

.NET Application Hangs When Calling DLL

Dec 28, 2010

Its been running in production for over a year and this is the first time I saw this behaviour. The application is a VB.NET Console Application which is triggered by MQ server. This application uses a class library which is part of the same project(Say 'abc.dll'). In production around 40+ instances of this exe are running and all of them use the some of the functions from 'abc.dll'.

Last week, we noticed that all the 40 instances were shown to be running in the task manager but they were not doing any activity. There was no exception thrown or error logged in Application logs or System logs. To frantically debug the problem, I tried isolating the problem.

With all these 40+ exes hung up, I wrote a small aplication which would use a reference to this 'a.dll', create an object of one of the classes in that dll and execute a method in there. I was printing console.writelines in between to see to which point it gets to before erroring out.

To my surprise, I found that at the point where I was creating an object of a class in 'a.dll' this sample test application would also hang just like the others. No exceptions thrown. So I killed all those applications as a last resort and then when I restarted all of them, everything worked fine.

I couldn't find any explanation for this behaviour. Since it was a critical error affecting a production system(blanking out the application for 3+ hours), I have to give a very good explanation as to why this would occur. how it can be prevented in future.

(Side note: the servers running these appilcation do not have a maintenance schedule and are supposed to be up for couple of months together.

View 11 Replies

Dataset Designer Hangs?

Nov 10, 2010

When using the Dataset Designer in VS 2010 I add a new query.It adds with no issue.Add another,starts to hang. Add another and now it can hang for hours.I use task manager to kill VS 2010 after 30 minutes.Go back into the same table adapter query, modify it, save it.Works in seconds.Add another query, hangs, hangs, hangs.I have seen posts about this going back to VS 2008.I have No Add-Ons loaded, what is causing this issue??

View 2 Replies

FTP Upload Works But Hangs

Jan 12, 2011

I have this code to upload to a ftp server. It works but the problem is it freezes the program and sometimes you can end up waiting for long time and not even know its working.
Code:
Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://" + txt_ftp_username.Text + ":" + txt_ftp_password.Text + "@" + txt_ftp_server.Text + ":" + txt_ftp_port.Value.ToString + "/" + txt_ftp_dir.Text + "/" + txt_ftp_name.Text), System.Net.FtpWebRequest)
[Code] .....
Can this code be modified so that it will run without freezing the program and then just add a button labelled "STOP" to stop the ftp connection/upload?

View 1 Replies

Hangs When I Switch To Design ?

Aug 21, 2009

I have downloaded SP1 and installed it,I have an applciation with 10 form and numerous classes and dialogs. When I right click a form in the soultion Explorer window and choose view Designer VS hangs for anything upto 10 mins. Is there anything that I can disable/ enable to stop this hapening. The only Language that I will be developing in is vb.net.

View 10 Replies

IDE :: VS 2010 Debugger Hangs (VB)?

Oct 3, 2011

Im developing several applications under Visual Studio, and now have a real nightmare in hands. When i start to debug, VS hangs completely. Windows allows me to start task admin, and close the "devenv" process.I have serious problems here. I need to deliver my projects before the deadline!

Win 7 Pro 32 bits, VS 2010 SP1, running on HP computer based on Intel i5, 4gb ram. everything works as intended, except VS. When debug crashes, the devenv process uses about 25% of CPU and 250~400Mb of ram.

View 12 Replies

Messagebox Hangs Program?

Mar 30, 2009

The messagebox shows properly but will not respond to mouse click and every is halted.. Comment out the messagebox event everything proceeds. No error is generated, things jest stop at themessagebox and willnot proceed. Code as follows:

[code]...

View 2 Replies

My Webbrowser Control Hangs

Jul 31, 2010

Using VB2005 I am trying to display several sites to my user. One of them being[url]... Ive laid down the very basic code just to navigate to the page but every time it tries to reach the site it just hangs. Strange is that Ive downloaded other examples of web browsers with very similar code and Im able to reach the site with no problems. Could the site be banning my specific app from reaching it and if so what mechanism would they use?

View 20 Replies

Program Hangs On Loop

Jul 25, 2011

my program seems to just freeze whenever I press this button. I need to be able to use this because I'm reading values from a joystick as i'm making a human interface device.

Why is this freezing?[CODE...]

View 3 Replies

VB 2008 Application Hangs?

Mar 6, 2011

I am writing my first application in Visual Basic Express 2008 and the program conistently hangs (Not responding in the Task Manager) midway through execution. The operating system is Windows XP Professional SP3 running on a 1.20 GHz Intel Core Duo CPU with 2 GB of RAM.

The application has very deep layers of subroutines and functions, all of which are using lots of math routines. There are no recursive routines anywhere in the program. The program creates and destroys quite a few class elements, and I have written dispose methods for all of them using IDisposable, setting all the properties to Nothing. I also use GC.Collect() to force garbide collection, and GC.WaitForPendingFinalizers(). As a result, I don't think there are any memory leaks.

I think the depth of sub and function calls are causing a stack overflow, but I'm not certain. I have tried without success to increase the stack allocation to 2 Mb using Editbin.exe after reading some forums, but nothing changed. I then searched my machine and did not find EDITBIN.EXE.When the program hangs up, the background of the forms on the screen turn to solid white and the controls are no longer visible.It looks like a window pops up but it disappears too quickly to read anything. If I view the task manager while the application is running it hangs immediately. I have not published it, I am still developing and running it out of the VB environment.The more complexity (sub and function calls) I add, the earlier the program hangs.

View 6 Replies

WebSite Monitoring App Hangs?

Mar 11, 2010

I am writing a fairly simple web site monitoring app. It uses a timer to call a class that requests a web page and measures the response. Problem is that the third time the class is called the app hangs. looking at the locals box I see that the properties of the httpURL object are 'Property Evaluation Failed' .

Imports System.Net
Imports System.Net.Sockets
Public Class Form1

[Code]......

View 2 Replies

Whenever Execute - Code Hangs ?

Nov 15, 2011

When ever i execute this code it hangs ..how to troubleshoot

Imports System.Net
Imports System.IO

Partial Class vbIPNexample

[CODE]...

View 1 Replies

.net - Thread.abort Hangs Forever

Sep 15, 2011

Code to launch a wmi query on remote computers. This code runs in several threads at the same time.

[Code]...

For Each objMgmt In oquery.Get 'on some pesky windows XP machines this line hangs forever regardless of the timeout and the thread can never be used to get info from another computer. the only way to "release" this is to reboot the target computer.

[Code]...

View 1 Replies

.Net Application Hangs If Lock System

Jun 21, 2010

I have a weired problem. I developed a multithreaded WinForm application using VB.Net, and SQL Server 2008. The application works perfectly fine if I am using Visual Studio IDE to run the same. But, if I run the exe file created by VS the application hangs in case I lock my system and again relogin. The memory usage is same as it was before locking the system. CPU usage is also 0% or by max 2%. All threads are also exited after finishing there designated tasks.The application also uses threading but all threads are exited after there designated tasks. I confirmed this using various tools.[code]

View 5 Replies

.Net Application Hangs When Added On Startup?

May 5, 2011

I have created a small multithreaded application using VB.NET. There is no problem when the user manually runs this application. A problem exists when I added this application on startup. It hangs after I rebooted the system. The application is still running its thread but I can't see its GUI because its frozen. If I kill it on task manager and started again, the application works fine. What could be the possible reason/s why this application hangs when added on startup?

Imports System.Threading
Public Class USBLock
Public Event Lock()

[Code]....

or just a thought on this subject: the reason why the program hangs on startup is because the application is loaded while the .net framework service has not yet started.

View 1 Replies

.NET Applications Hangs On Remote Desktop?

Aug 13, 2009

I have a problem with a large application that consists of windows forms mainly, but some WPF windows and controls (we also use DevExpress controls v9.1). The problem is that the application sometimes hangs when it runs in a remote desktop session, and that session gets locked due to inactivity, and the user comes back and unlocks the session. The hang seems very similar to the hangs you get when accessing GUI controls from a none GUI thread, but I'm pretty sure that's not what causes the problem. (We had a lot of those problems earlier, and have fixed all multithreading problems we were able to find. And the hangs now never occures when the application runs outside the remote desktop environment.)

I've done a lot of research on the problem but I've still not found a clear point to what causes the problem. However, I think there might be a problem related to some combination of remote desktop and .NET framework. The reason for this is posts like this:

[Code]...

View 9 Replies

Application Form Hangs But It Is Working

Apr 21, 2011

I have win7 pro, on my win form is a traffic light icon(when it starts it is red, when finished it is green), so that I know when job is finished. But when I run application icon isn't changing and form hangs it self, can not do nothing until job is finished. Only in the end, I see that icon is quickly changes to red and then back to green.

View 1 Replies

Application Hangs On Call To Doevents?

Dec 22, 2010

I am re-posing this question because the prior post has gotten really full of side issues so I fear the main problems has been lost.I have a windows forms application written in VB.NET which scrapes information from serveral web pages? I am having problem with one particular site where partway through the page navigation my application hangs. When I press pause (or break) in the debugger, it stops on a call to System.Windows.Forms.Application.DoEvents.

View 7 Replies

Form Hangs When Inserting Data

Aug 21, 2010

How to solve a form hangs problem during on inserting data to the database?

[Code]....

View 2 Replies

Hangs With LINQ-SQL Server And TransactionScope

Mar 17, 2010

I'm encountering a hang when the program tries to access the fruit database. I've already enabled network access MSDTC on both my development computer and the SQL Server server.

[Code]...

View 1 Replies

HTTPWebRequest For Loop Hangs Every 10 Or So Iterations

Jan 14, 2011

I am trying to loop through an array and perform an httpwebrequest in each iteration. The code seems to work, however it pauses for a while (eg alot longer than the set timeout. Tried setting that to 100 to check and it still pauses) after every 10 or so iterations, then carries on working.

Here is what I have so far:
For i As Integer = 0 To numberOfProxies - 1
Try
'create request to a proxyJudge php page using proxy
Dim request As HttpWebRequest = HttpWebRequest.Create("[URL]")
request.Proxy = New Net.WebProxy(proxies(i)) 'select the current proxie from the proxies array
request.Timeout = 10000 'set timeout
[Code] .....

I have tried a using block, eg:
Using response As HttpWebResponse = request.GetResponse()
Using sr As StreamReader = New StreamReader(response.GetResponseStream())
Dim pageSourceCode As String = sr.ReadToEnd()
'check the downloaded source for certain phrases, each identifies a type of proxy
[Code] .....

Does the try catch statement automatically close the response, or do I need to put something in Finally? If so, what? i cant use response.close() because its declared in the try block.

View 2 Replies

Program Hangs For A Few Seconds Before Closing

Mar 23, 2010

When I close my compiled application, it will always hang for a few seconds before closing. It isn't something to do with my PC, I've got a quad core with 4GB of RAM -[code]...

View 4 Replies

Program Hangs When Fonts Are Changed?

Apr 12, 2011

I have a strange problem that I can't seem to find any answers on. I wrote two programs in VB2010. Both work great, install and uninstall no problem and I have done this on 4-5 PC's and laptops, all running Win7. A friend saw them and asked if he could use the programs, but when he installed them neither of them would work. All the prereq's were there and he is also running Win7. For some reason all of a sudden his enlarged font reset itself and VIOLA! both programs started working. I have retested this and it fails/works every time.

So my question is, how do I fix this or is it fixable? Is there somewhere in VB where this has to be set to be 'flexible'??

View 8 Replies

SqlDependency Hangs When Setting Up Second Time?

Nov 8, 2010

What I am trying to do is allow for my objects to know when their data has changed on the database (so they are able to raise an event to let the user of the object know about the change).After following several tutorials on how to get SqlDependency working, I have finally managed to get it to let me know when something changes (although it also appears to let me know when I make the initial connection to it too, but that isn't a problem as I can work around that).The function that I have which sets up the SqlDependency is;

Public Function getMembers() As List(Of User)
Dim conn As New SqlConnection(_connectionString)
Dim sql As String = "SELECT UserGroupUserID, UserID, GroupID FROM dbo.xtblUserGroupUsers

[code].....

View 9 Replies

Treeview Hangs On Node Insert?

Oct 30, 2009

why my program hangs up on the following line? I am inserting a node into a treeview.

loc_node.Nodes.Insert(index, temp_node)

I get no error, no exception, it just sits there running for ever.

View 15 Replies

UI Hangs While Updating 1000 Labels?

Oct 5, 2010

I have a windows form where i try to update a form which has 1000 labels. By update i mean i try to set the color of the labels. And i am doing this update in windows form timer every 1 sec.

My problem is the UI freezes. I tried using a thread. In the thread i tried to call the update code, but still the UI hangs.

View 1 Replies







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