0

I want to make a C# tcp server and client connection. Instead of specifying the IP Address of the server in the client-side program itself, I want to use a 'Config file' which will store the IP Address and port Address of the server.And then I want the client program to fetch the IP Address of server from that 'Config file' only.

How to achieve this? Please guide.Any Suggestions will be appreciated. Thanks.

user2900761
  • 111
  • 1
  • 3
  • 15
  • Have a look at [How to: Add an Application Configuration File to a C# Project](https://msdn.microsoft.com/en-us/library/ms184658.aspx) – Adriaan Stander Feb 18 '15 at 04:37
  • check this also http://stackoverflow.com/questions/13043530/what-is-app-config-in-c-net-how-to-use-it – Vasistan Feb 18 '15 at 04:43

1 Answers1

0

I solved my question by doing following steps:

  1. Instead of making a config file, I made a text file.
  2. Read the Strings from the text file by using ReadAllLines() 3.Used the fetched strings in the program.

This was quite easy and it also serves the purpose of fetching the IP Address And Port address of the server.

user2900761
  • 111
  • 1
  • 3
  • 15