Results 1 to 4 of 4

Thread: Help with reading an external file and using the information in my application

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    13

    Help with reading an external file and using the information in my application

    I have created an application that sends emailsto multiple recipients.
    I use a connection to Outlook to send the mail.
    All is working well except that everytime some peice of information changes such as email address or name i have to amend my code and recompile.
    Also for every address that i want to send to i have to have a seperate procedure and at the end of each it calls the next one.
    is there a way i can hold all the details (email address etc) in an external file (such as CSV or TXT) that the application can read in and during a looping process goes through the list until it reaches the end and then continues with the program.
    The details i need in my external file are Shop number (5 digits eg 00011), Shop Name (upto 25 char eg Northcote Road) and Email Address (eg [email protected])
    In each loop of the procedure the following changes: Shop Name, Shop Number, Email Address.
    Any help would be greatly appreciated

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Help with reading an external file and using the information in my application

    You should use the config file to store this information and then access it via the System.Configuration namespace. The config file is XML so is easily human-editable after the application has been installed.

    http://support.microsoft.com/default...b;en-us;321585
    http://msdn2.microsoft.com/en-us/library/2tw134k3.aspx
    http://msdn.microsoft.com/library/de...onSections.asp
    http://msdn.microsoft.com/library/de...ionsschema.asp
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Addicted Member corwin_ranger's Avatar
    Join Date
    Sep 2004
    Location
    CT
    Posts
    198

    Re: Help with reading an external file and using the information in my application

    Here is a possibly easier solution. Why not create Distribution Lists to cover who should receive the emails and then mail to that DL. You probably should still use a config file to define which DLs to send to, but if you send to DLs, you shouldn't even really need to modify anything in the config file very often.

    Just my $.02

    Steve

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Posts
    13

    Re: Help with reading an external file and using the information in my application

    This would be ok if i was sending the same file to all address, but it is a different file for each address.

    thanks anyway

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width