473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB6-> VB.net .. problems

Hi,

I know VB6 pretty well but has just started to work on VB.net.

I am experiencing problems during my tests and I wonder if someone can
advise me.

Q1: I use the Shell function to run external 'console' programs. These
console programs display information on the screen while working.
Because I use the shell function, I would like to be able to grab what the
'console displays' on the screen to see if this console program works fine.
I basically tried to run something like 'c:\Consoleprog.exe > prog.txt' but
I never get the prog.txt with the shell function. It works fin in command
line.
So : Is it the best way to do what I want to do ? (I don't think so)
What is going on ?

Q2: I have a VB.net Service. This service is working fine. I would like to
create a function in my service that can be called from a script (.vbs). I
wonder what is the best and most simple option. Com ? Other ?
If you can advise me (because it is a service) and give me a sample code to
test this.

Thanks for you help.

Regards
SN
Nov 21 '05 #1
1 1067
Hi,

Answer to question 1

Dim pi As New ProcessStartInfo

Dim p As Process

pi.RedirectStandardOutput = True

pi.FileName = "c:\pubsconsole.exe"

pi.UseShellExecute = False

Dim sw As New System.IO.StreamWriter("C:\MyOutPut.txt")

p = Process.Start(pi)

sw.WriteLine(p.StandardOutput.ReadToEnd)

p.WaitForExit()

sw.Close()

Ken

------------------------------------

"Snoop" <Sn***@discussions.microsoft.com> wrote in message
news:F5**********************************@microsof t.com...
Hi,

I know VB6 pretty well but has just started to work on VB.net.

I am experiencing problems during my tests and I wonder if someone can
advise me.

Q1: I use the Shell function to run external 'console' programs. These
console programs display information on the screen while working.
Because I use the shell function, I would like to be able to grab what the
'console displays' on the screen to see if this console program works fine.
I basically tried to run something like 'c:\Consoleprog.exe > prog.txt' but
I never get the prog.txt with the shell function. It works fin in command
line.
So : Is it the best way to do what I want to do ? (I don't think so)
What is going on ?

Q2: I have a VB.net Service. This service is working fine. I would like to
create a function in my service that can be called from a script (.vbs). I
wonder what is the best and most simple option. Com ? Other ?
If you can advise me (because it is a service) and give me a sample code to
test this.

Thanks for you help.

Regards
SN
Nov 21 '05 #2

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

Similar topics

4
by: Kieran Benton | last post by:
Hi everyone, I'm just looking into this for my boss (and myself I suppose). What is the current state of VB6 to VB.NET converters out there and what are they? I'm trying to convince our company to...
3
by: Peter | last post by:
Hi, My C# application is supposed to cooperate with legacy VB6 code, but I am little bit worried if and how far C# strings, double etc. in the method interfaces will work smoothly from VB6...
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
16
by: Ben Hannon | last post by:
Hi, I'm writting a COM Class in VB.NET to be used in a VB6 project (Tired of the VB6 hassles with cloning and serializing an object). All my classes I need cloneable/serializable are now in a...
13
by: Metallicraft | last post by:
I have a vb6 application. On the main form is a picture box with one or two images and several pieces of text displayed in it. These are created on the fly using gdi32 routines that are all in a...
66
by: Mitchell S. Honnert | last post by:
In some recent posts, I've seen people who seem to be waxing nostalgic with respect to the "ease of use" of Visual Basic 6. I can't quite put my finger on it, but they seem to be implying that VB6...
9
by: Terry | last post by:
I am converting (attempting) some vb6 code that makes vast use of interfaces. One of the major uses is to be able to split out Read-only access to an obect. Let me give you a simple (contrived)...
10
by: AK | last post by:
Hello All, We received this in response to a question we had posed at a trade show meeting. Our proposed app's target features consist of a business application to crunch numbers, show...
1
by: Bartholomew Simpson | last post by:
I know this is a VB.Net ng. But hopefully, someone remembers some classic (VB6) coding - besides I've not had any response when I posted this to the VB6 specific ng. I wrote a C++ librray that I...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.