473,804 Members | 3,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

console.write

vb.net 2003 - console program

i've read a array of machines and i wishes to display on console the
machines name on the *same line.* How do i do this ? This is what i want

say i got a text file that contains
machine001
machine002

it shld display in console as

computer : machine001 (machine 001 will disappear, then machine002 will
appear on the same line and on the same location/placeholder)

eg

dim computer as string

for each computer in machinesarray
console.write(c omputer)
next
Feb 15 '06 #1
1 2506
Using Console.Write(c omputer) on it's own means that that subsequent calls
will write at the next position giving:

computer : machine001machi ne002... etc.

If I understand you correctly what you want to see is:

computer : machine001

and then

computer : machine002

in place of what was written previously, thus giving the effect of the
machine name counting up.

To achieve this you need to force the next position back to the beginning of
the line by writing a carriage return:

Console.Write(" computer : " & computer & ControlChars.Cr )

Now, in a tight loop like:

For Each computer In machinesarray
Console.Write(c omputer & ControlChars.Cr )
Next

it is all going to happen so fast that you are only ever going to see the
final entry.

You need to add as timing delay so that you can see it happening:

For Each computer In machinesarray
Console.Write(c omputer & ControlChars.Cr )
Thread.Sleep(10 00) ' Wait for 1 second
Next

Adjust the parameter of the Sleep method to control the delay between
iterations of the loop.
"James" <jk****@hotmail .com> wrote in message
news:uQ******** ********@TK2MSF TNGP10.phx.gbl. ..
vb.net 2003 - console program

i've read a array of machines and i wishes to display on console the
machines name on the *same line.* How do i do this ? This is what i want

say i got a text file that contains
machine001
machine002

it shld display in console as

computer : machine001 (machine 001 will disappear, then machine002 will
appear on the same line and on the same location/placeholder)

eg

dim computer as string

for each computer in machinesarray
console.write(c omputer)
next

Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5389
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my application (VB.NET) will start a process, redirect its stdout and capture that process' output, displaying it in a window. I've written a component for this, and a test application for the component. It allows me to specify a command to execute,...
3
9034
by: Wayne | last post by:
I have a console application (ssh2.exe) that requires keystrokes to be sent to it after activating. I have worked that it needs to be started in it own thread, but capturing the process and sending the keystrokes escapes me at the moment. Is there any material online that describes the process of sending keystrokes to a console app?
5
11262
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough to avoid the overhead of writing to the console if it is not visible, eg I am running inside a WinForm application. thanks
17
4240
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to console using System.Console.WriteLine if thge project has its "Output Type" to "Windows Application". However I can write to stdio if i set output type to "Console Application". When I do this I unfortunately get a "console box" as well
7
2310
by: mabra | last post by:
Hi All ! Problem:Reading/duplicating "Console.In" fails for unknown reason. I wrote a little console helper tool, named TEE, which just duplicates the StdIn to the StdOut AND an additional stream. Looks working basically and the part that does this is like the following: private static void CopyStream(TextWriter outStream, bool dup) {
3
11377
by: julianmoors | last post by:
Hey, Currently I'm writing a VB.NET/1.1 app and I need to mask the input for the password field. Does anyone know how to do this in VB? I've seen a C# example, but wouldn't know how to convert it myself. Here's the URL: http://www.codeproject.com/dotnet/ConsolePasswordInput.asp
6
5717
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it possible to use Console.Writeln when you have a Webservice. I don't think it's possible but just to be sure I ask you?
2
1610
by: castironpi | last post by:
Presents a console permitting inspection. Input as well as output saved in Python-readable form. Python 2.5.1 memoryconsole4.py logging to My Documents\console.log .... def f( self ): .... print 2 .... '\tdef f( self ):\n\t\tprint 2\n' This enabled by a log file, optionally set to console.log. Contents are:
5
10783
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in server. Now, every console program instance will open a command mode window and they occupy the whole screen. I want to minimize all of them and maximize it if neccessary by manual. Is it possible and how to do it? I'm using VB.NET 2005. ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.