473,698 Members | 2,503 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need Help with Output to Text

Here's my script--need help with output to text file (must be missing
something here like closing the file or something). Any help would be
greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
Source...

Dim vFileName As String
vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
Dim oFile As System.IO.File
Dim oWrite As System.IO.Strea mWriter
oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")

FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT TO
WRITE TO FILE
oWrite.WriteLin e("Debugging Code is Fun")
oWrite.WriteLin e("And Pigs Fly")
Todd
Jul 17 '05 #1
2 11387

This group is really for VB6 and earlier. I recommend you take a look at the
groups devoted exclusively to .net programming on the microsoft news server,
named such as:

news://msnews.microsoft.com/microsof...dotnet.general
news://msnews.microsoft.com/microsof...t.languages.vb
news://msnews.microsoft.com/microsof....vsnet.general
news://msnews.microsoft.com/microsof...studio.general
news://msnews.microsoft.com/microsof....vstudio.setup

.... etc.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Todd Shillam" <tshillam(@)hot mail.com> wrote in message
news:TI******** ************@co mcast.com...
: Here's my script--need help with output to text file (must be missing
: something here like closing the file or something). Any help would be
: greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
: Source...
:
: Dim vFileName As String
: vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
: Dim oFile As System.IO.File
: Dim oWrite As System.IO.Strea mWriter
: oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")
:
: FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT
TO
: WRITE TO FILE
: oWrite.WriteLin e("Debugging Code is Fun")
: oWrite.WriteLin e("And Pigs Fly")
:
:
: Todd
:
:

Jul 17 '05 #2
Randy,

I got it; however, thanks for the references--I'll be sure to check them
out.

Best regards,

Todd

"Randy Birch" <rg************ @mvps.org> wrote in message
news:EP******** ************@ro gers.com...

This group is really for VB6 and earlier. I recommend you take a look at
the
groups devoted exclusively to .net programming on the microsoft news
server,
named such as:

news://msnews.microsoft.com/microsof...dotnet.general
news://msnews.microsoft.com/microsof...t.languages.vb
news://msnews.microsoft.com/microsof....vsnet.general
news://msnews.microsoft.com/microsof...studio.general
news://msnews.microsoft.com/microsof....vstudio.setup

... etc.

--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Todd Shillam" <tshillam(@)hot mail.com> wrote in message
news:TI******** ************@co mcast.com...
: Here's my script--need help with output to text file (must be missing
: something here like closing the file or something). Any help would be
: greatly appreciated here. Lastly, I'm using Visual Basic .NET 2003.
: Source...
:
: Dim vFileName As String
: vFileName = Format(Now(), "MM - dd - yyyy") & " - " & vName
: Dim oFile As System.IO.File
: Dim oWrite As System.IO.Strea mWriter
: oWrite = oFile.CreateTex t("C:\" & vFileName & ".txt")
:
: FileOpen(1, "C:\" & vFileName & ".txt", OpenMode.Output ) 'CAN'T GET TEXT
TO
: WRITE TO FILE
: oWrite.WriteLin e("Debugging Code is Fun")
: oWrite.WriteLin e("And Pigs Fly")
:
:
: Todd
:
:

Jul 17 '05 #3

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

Similar topics

0
238
by: TN Bella | last post by:
This may be a double post... I appreciate all the help I have gotten on here - thank you! So with that in mind, I figured I would try another post! :) I need to reformat the following information like this: txtacctnum txtcostcntr txtrefnum txtacctamt txtacctnum1 txtcostcntr1 txtrefnum1 txtacctamt1 txtacctnum2 txtcostcntr2 txtrefnum2 txtacctamt2
2
2955
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import namespace="System.Web.UI.WebControls" %> <%@ import namespace="System.Data" %> <%@ import namespace="System.Data.OleDb" %>
0
3570
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
4
2199
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
6
2123
by: naknak | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
1
4751
by: Osoccer | last post by:
...to a different folder and in the relocated file concatenates all of the lines in one long string with a space between each line element. Here is a fuller statement of the problem: I need a Visual Basic Script file, call it "Move and Reformat Text File.VBS," that will run from a Windows Script Host command-prompt-based version as follows: C:\> Cscript.exe "Move and Reformat Text File.VBS" The objective of the VBScript file, "Move...
2
11195
by: lifeshortlivitup | last post by:
I had to create a program that allows the user to input a temp and then click on either the convert to fahrenheit or convert to celsius button and then display that result within the textbox that says "user entered amount in F or C is equal to answer degrees F or C." I have the code written for the convert to Fahrenheit but do not understand how to get the converted temp to display in the text box along with the above desired text. Below is my...
14
3147
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an explanation? Thanks, M. McDonnell
3
3666
by: Water Cooler v2 | last post by:
Sorry for asking this beginner question. I've written DTDs so far and read about XML Schemas. I understand that they are a replacement of the DTD fundamentally, and therefore allow for the validation of an XML document. My question really is: Why do we need XML Schemas other than for validation of an XML document? I am more interested in knowing if already available
0
8680
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
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
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
7738
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
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.