CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 5/22/2006 1:28:52 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 66 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
yogaraj
Asp.Net User
How to read .txt files from console application?5/22/2006 1:28:52 PM

0/0

Hi All,

I am working in Visual Studio 2005. I have developed one scheduler for to sending mails to customer periodically. Now i have hard coded the "from address" and "smtpclient ip address".

Instead of this i want to read these values from one text file. How can i do this one.

If anyone knows the solution please help me.

This is very urgent.

Following is my code.

Dim intPriorDays = 3

Dim ObjDs As DataSet = New DataSet

Dim strsql As String = "SELECT a.Email from Customer"

ObjDs = SqlHelper.ExecuteDataset(SqlHelper.PBP_GetConnectionString, CommandType.Text, strsql)

Dim intRecCnt As Integer = ObjDs.Tables.Count

Dim i As Integer

For i = 0 To intRecCnt - 1

If (ObjDs.Tables(0).Rows(i)("Amount").ToString) > 0 Then

Dim objMail As MailMessage = New MailMessage

objMail.From = New MailAddress("[email protected]")

objMail.To.Add(ObjDs.Tables(0).Rows(i)("Email").ToString)

objMail.Subject = "Payment Reminder"

objMail.Body = "You have to pay " + ObjDs.Tables(0).Rows(i)("Amount").ToString + " on or before " + ObjDs.Tables(0).Rows(i)("InvoiceDueDate").ToString

Dim SmtpMail As SmtpClient = New SmtpClient("192.10.10.99")

SmtpMail.Send(objMail)

End If

Next i

 

Thanks in advance.

Best Regards,

Yogaraj.C

mkamoski
Asp.Net User
Re: How to read .txt files from console application?5/22/2006 2:22:46 PM

0/0

 

Here is a complete online sample that should help...

http://vb1.weblogicarts.com/WebForms/DemoFileInputAndOutput01.aspx

...and here is an excerpt from that sample...


'...

Try
 '...
 

    'Get the full-path to the file.
    Dim myFile As String = Me.RetrieveRadioButtonList.SelectedValue

    If (File.Exists(myFile)) Then
        myStreamReader = File.OpenText(myFile)
        Me.RetrieveTextBox.Text = myStreamReader.ReadToEnd()
    Else
        Me.RetrieveStatusLabel.Text = "File DNE."
    End If
   
    '...
Finally
    If (Not myStreamReader Is Nothing) Then
        myStreamReader.Close()
    End If
End Try

'...

HTH.

Thank you.

--Mark Kamoski


http://www.WebLogicArts.com
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath Authors: Eric Carter, Eric Lippert, Pages: 992, Published: 2006
Programming .NET Windows Applications Authors: Jesse Liberty, Dan Hurwitz, Pages: 1228, Published: 2003
Visual Basic 2008 Recipes: A Problem-Solution Approach Authors: Todd Herman, Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 680, Published: 2008
Beginning C# 2008: From Novice to Professional Authors: Christian Gross, Pages: 487, Published: 2007
Beginning VB 2008: From Novice to Professional Authors: Christian Gross, Pages: 450, Published: 2008
Beginning Visual C# 2005 Authors: Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White, Pages: 1062, Published: 2006
Learning C# 2005: Get Started with C# 2.0 and .NET Programming Authors: Jesse Liberty, Brian MacDonald, Pages: 528, Published: 2006
Visual C# 2005 Recipes: A Problem-Solution Approach Authors: Allen Jones, Matthew MacDonald, Rakesh Rajan, Pages: 565, Published: 2006
The art of assembly language Authors: Randall Hyde, Pages: 0, Published: 2003
Visual Basic 2005 Programmer's Reference Authors: Rod Stephens, Pages: 1022, Published: 2005

Web:
Read text file through console application - VB.NET Read text file through console application - VB.NET Community and Forum - Our VB .NET forum is the place for Q&A-style discussions related to ...
CodeProject: DeleteOld : Console Application to Delete Files by ... AC# console application for deleting files based on age.; ... CTextFileDocument lets you write and read text files with different encodings (ASCII, UTF-8, ...
How to create a console application using vb.net and schedule ... Actually I need to create a console application. It will run from command prompt . The file is to read a text file. It has two folder names. ...
can we read pdf content into console application or text file ... Topic: can we read pdf content into console application or text file? Conf: (P- PDF) Developers, Msg: 155276 From: ramkrishnamca Date: 10/18/2006 08:06 PM ...
Download TextMaster S & J Console Application 3.0 Free Trial ... Sep 1, 2008 ... TextMaster S & J Console Application Publisher's Description. Quick and easy way for the splitting text files into any number of smaller ...
Sample Applications Usage information for each sample is contained in a readme.txt file in each ... ReadFromStream, This console application sample shows how to read data from ...
Need a Simple Visual Basic .NET Console Application Made by tomorrow NET Console Application Made by tomorrow (from Buy, Sell or Trade) ... Read the grades.txt file, which contains all of the individual exam ...
Calling a console application from ASP.Net - ASP.NET Forums Hey I need quickly code for console application which call asp.net .... and halfway because the windows utility does not read the text files ...
VS Console Applications Read);. Append Opens the file if it exists and seeks to the end of the file, ... Write a console application that creates a file "garden.txt" and copies ...
NO GUI Delphi applications - Page 2/2 Creating a console mode application with Delphi; a text-mode program that runs ... The standard file variable Input is a read-only file associated with the ...

Videos:
Visual basic 2008 login tutorial-Part 1 of 3 Login button code: If TextBox1.Text = "" And TextBox2.Text = "" Then MsgBox("Error, You need to enter your Username and Password!", MsgBo...
GET FREE CONSOLE GAMES LINK http://rapidshare.com/files/100287547/CONSOLE_GAMES_DOWNLOAD_WEBSITE_AND_THE_FULL_LIST_OF_GAMES.txt, this link is a link i found on rapidshare, so pl...
ASDT screen cast - ConsoleLogger ASDT is a ActionScript2 development tool for the Eclipse Platform. In this short screen cast you can learn how to set up a project, compile an swf an...
Texture swapping - Fhqwhgads For the ones who don't know who or what fhqwhgads is, it's a "name" in the Homestar Runner universe. It's short for "fhqwhgadshgnsdhjsdbkhsdabkfabkve...
FF XII - Getting Fomalhaut Read ! Just want you to know that Fomalhaut in Lhusu Mines (chest) is respawn, so you can get as much as you want. Easier if you already killed Antl...
The Twilight Hack Tutorial. THIS IS A GUIDE TO INSTALLING VIRTUAL CONSOLE GAMES (.WAD FILES) ONTO YOUR WII WITHOUT HAVING TO BUY THEM OFF THE WII SHOP CHANNEL. PLEASE DO NOT ASK...
Video Glasses Evg920d lunette multimedia brille ecran lcd dv http://www.gusdeluxe.info/Catalog/video-glasses-80-evg920d-p-206.html This device can be connected to PC & Notebook through VGA and other devices th...
Portable Video Glasses MT320 lunette multimedia brille ecran http://www.gusdeluxe.info/Catalog/mt320-mobile-theatre-video-glasses-p-252.html Available at http://www.maxweels.fr MT320 Mobile Theatre with 80inc...




Search This Site:










vs 2005

password policy in visual studio 2005

can i use a c/c++ from a vb.net program?

remove vs output window

"add service reference" context menu option not available

xml commenting

availability of beta 2?

problems with menu control

problem installing vs 2005

vs2005 install beside vs2003 must ask question to ease my mind

debugging asp.net while using https

new website menu option not available

checking in code into vss directly from vs 2005

css editor is not responding

gridview sort and select problem

hide errors from visual studio 2005 error list

vs2005 beta 2 ftp username & password save facility?

visual studio and cpu usage

control did not go to breakpoint in asp.net in debug mode

web crawler source code urgently needed

how to use dpapi (user store) from asp.net with enterprise services

how can you duplicate a project?

visual studio whidbey

problems of hosting winform usercontrol

adding class library reference in asp.net 2.0

webapplication project is not available after installing sp1.

bind to existing folders in vss 6

missing vs 2005 build menu items

help me. error code happened when installing vs2005 professional

vs 2005 web deployment projects

  Privacy | Contact Us
All Times Are GMT