Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 818589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:10:34+00:00 2026-05-15T02:10:34+00:00

I have to write the data below to a textfile after replacing two values

  • 0

I have to write the data below to a textfile after replacing two values with ##IP##, ##PORT##.
What is the best way? Should I hold all in a string and use Replace and write to textfile?

Data:

[APP]
    iVersion=   101
    pcVersion=  1.01a
    pcBuildDate=Mar 27 2009
[MAIN]
    iFirstSetup=        0
    rcMain.rcLeft=    676
    rcMain.rcTop=     378
    rcMain.rcRight=  1004
    rcMain.rcBottom=  672
    iShowLog=           0
    iMode=              1
[GENERAL]
    iTips=              1
    iTrayAnimation=     1
    iCheckColor=        1
    iPriority=          1
    iSsememcpy=         1
    iAutoOpenRecv=      1
    pcRecvPath=         C:\Documents and Settings\karthikeyan\My Documents\Downloads\fremote101a\FantasyRemote101a\recv
    pcFileName=         FantasyRemote
    iLanguage=          1
[SERVER]
    iAcceptVideo=       1
    iAcceptAudio=       1
    iAcceptInput=       1
    iAutoAccept=        1
    iAutoTray=          0
    iConnectSound=      1
    iEnablePassword=    0
    pcPassword=
    pcPort=          7902
[CLIENT]
    iAutoConnect=       0
    pcPassword=
    pcDefaultPort=   7902
[NETWORK]
    pcConnectAddr=##IP##
    pcPort=##Port##
[VIDEO]
    iEnable=                  1
    pcFcc=                 AMV3
    pcFccServer=           
    pcDiscription=         
    pcDiscriptionServer=   
    iFps=                    30
    iMouse=                   2
    iHalfsize=                0
    iCapturblt=               0
    iShared=                  0
    iSharedTime=              5
    iVsync=                   1
    iCodecSendState=          1
    iCompress=                2
    pcPlugin=              
    iPluginScan=              0
    iPluginAspectW=          16
    iPluginAspectH=           9
    iPluginMouse=             1
    iActiveClient=            0
    iDesktop1=                1
    iDesktop2=                2
    iDesktop3=                0
    iDesktop4=                3
    iScan=                    1
    iFixW=                   16
    iFixH=                    8
[AUDIO]
    iEnable=                  1
    iFps=                    30
    iVolume=                  6
    iRecDevice=               0
    iPlayDevice=              0
    pcSamplesPerSec=    44100Hz
    pcChannels=      2ch:Stereo
    pcBitsPerSample=      16bit
    iRecBuffNum=            150
    iPlayBuffNum=             4
[INPUT]
    iEnable=                  1
    iFps=                    30
    iMoe=                     0
    iAtlTab=                  1
[MENU]
    iAlwaysOnTop=             0
    iWindowMode=              0
    iFrameSize=               4
    iSnap=                    1
[HOTKEY]
    iEnable=                            1
    key_IDM_HELP=              0x00000070
    mod_IDM_HELP=              0x00000000
    key_IDM_ALWAYSONTOP=       0x00000071
    mod_IDM_ALWAYSONTOP=       0x00000000
    key_IDM_CONNECT=           0x00000072
    mod_IDM_CONNECT=           0x00000000
    key_IDM_DISCONNECT=        0x00000073
    mod_IDM_DISCONNECT=        0x00000000
    key_IDM_CONFIG=            0x00000000
    mod_IDM_CONFIG=            0x00000000
    key_IDM_CODEC_SELECT=      0x00000000
    mod_IDM_CODEC_SELECT=      0x00000000
    key_IDM_CODEC_CONFIG=      0x00000000
    mod_IDM_CODEC_CONFIG=      0x00000000
    key_IDM_SIZE_50=           0x00000074
    mod_IDM_SIZE_50=           0x00000000
    key_IDM_SIZE_100=          0x00000075
    mod_IDM_SIZE_100=          0x00000000
    key_IDM_SIZE_200=          0x00000076
    mod_IDM_SIZE_200=          0x00000000
    key_IDM_SIZE_300=          0x00000000
    mod_IDM_SIZE_300=          0x00000000
    key_IDM_SIZE_400=          0x00000000
    mod_IDM_SIZE_400=          0x00000000
    key_IDM_CAPTUREWINDOW=     0x00000077
    mod_IDM_CAPTUREWINDOW=     0x00000004
    key_IDM_REGION=            0x00000077
    mod_IDM_REGION=            0x00000000
    key_IDM_DESKTOP1=          0x00000078
    mod_IDM_DESKTOP1=          0x00000000
    key_IDM_ACTIVE_MENU=       0x00000079
    mod_IDM_ACTIVE_MENU=       0x00000000
    key_IDM_PLUGIN=            0x0000007A
    mod_IDM_PLUGIN=            0x00000000
    key_IDM_PLUGIN_SCAN=       0x00000000
    mod_IDM_PLUGIN_SCAN=       0x00000000
    key_IDM_DESKTOP2=          0x00000078
    mod_IDM_DESKTOP2=          0x00000004
    key_IDM_DESKTOP3=          0x00000079
    mod_IDM_DESKTOP3=          0x00000004
    key_IDM_DESKTOP4=          0x0000007A
    mod_IDM_DESKTOP4=          0x00000004
    key_IDM_WINDOW_NORMAL=     0x0000000D
    mod_IDM_WINDOW_NORMAL=     0x00000004
    key_IDM_WINDOW_NOFRAME=    0x0000000D
    mod_IDM_WINDOW_NOFRAME=    0x00000002
    key_IDM_WINDOW_FULLSCREEN= 0x0000000D
    mod_IDM_WINDOW_FULLSCREEN= 0x00000001
    key_IDM_MINIMIZE=          0x00000000
    mod_IDM_MINIMIZE=          0x00000000
    key_IDM_MAXIMIZE=          0x00000000
    mod_IDM_MAXIMIZE=          0x00000000
    key_IDM_REC_START=         0x00000000
    mod_IDM_REC_START=         0x00000000
    key_IDM_REC_STOP=          0x00000000
    mod_IDM_REC_STOP=          0x00000000
    key_IDM_SCREENSHOT=        0x0000002C
    mod_IDM_SCREENSHOT=        0x00000002
    key_IDM_AUDIO_MUTE=        0x00000073
    mod_IDM_AUDIO_MUTE=        0x00000004
    key_IDM_AUDIO_VOLUME_DOWN= 0x00000074
    mod_IDM_AUDIO_VOLUME_DOWN= 0x00000004
    key_IDM_AUDIO_VOLUME_UP=   0x00000075
    mod_IDM_AUDIO_VOLUME_UP=   0x00000004
    key_IDM_CTRLALTDEL=        0x00000023
    mod_IDM_CTRLALTDEL=        0x00000003
    key_IDM_QUIT=              0x00000000
    mod_IDM_QUIT=              0x00000000
    key_IDM_MENU=              0x0000007B
    mod_IDM_MENU=              0x00000000
[OVERLAY]
    iIndicator=            1
    iAlphaBlt=             1
    iEnterHide=            0
    pcFont=     MS UI Gothic
[AVI]
    iSound=                    1
    iFileSizeLimit=       100000
    iPool=                     4
    iBuffSize=                32
    iStartDiskSpaceCheck=      1
    iStartDiskSpace=        1000
    iRecDiskSpaceCheck=        1
    iRecDiskSpace=           100
    iCache=                    0
    iAutoOpen=                 1
    pcPath=C:\Documents and Settings\karthikeyan\My Documents\Downloads\fremote101a\FantasyRemote101a\avi
[SCREENSHOT]
    iSound=       1
    iAutoOpen=    1
    pcPath=       C:\Documents and Settings\karthikeyan\My Documents\Downloads\fremote101a\FantasyRemote101a\ss
    pcPlugin=   BMP
[CDLG_SERVER]
    mrcWnd.rcLeft=      667
    mrcWnd.rcTop=       415
    mrcWnd.rcRight=    1013
    mrcWnd.rcBottom=    634
[CWND_CLIENT]
    miShowLog=            0
    m_iOverlayLock=       0
[CDLG_CONFIG]
    mrcWnd.rcLeft=      467
    mrcWnd.rcTop=       247
    mrcWnd.rcRight=    1213
    mrcWnd.rcBottom=    802
    miTabConfigSel=       2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:10:34+00:00Added an answer on May 15, 2026 at 2:10 am

    I suggest you just read the file and replace. It should be fine. If you’re worried about performance I suggest you measure the performance and try to fix later if it’s a problem.

    Example.

    string file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "foo.file");
    string s = File.ReadAllText(file);
    
    s = s.Replace("##IP##", "127.0.0.1");
    s = s.Replace("##PORT##", "80");
    
    File.WriteAllText(file, s);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 492k
  • Answers 492k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer a) In a multi-module build, you should always build from… May 16, 2026 at 10:29 am
  • Editorial Team
    Editorial Team added an answer It's a pretty inefficient algorithm. The complexity is O(n2). You… May 16, 2026 at 10:29 am
  • Editorial Team
    Editorial Team added an answer It looks like you haven't used the IIS Management tool… May 16, 2026 at 10:28 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a thread that needs to write data from an in-memory buffer to
Let's say I want to have a function which reads data from the SerialPort
We have data stored in oracle 10g db which contains french character set. The
I have a rather complex data structure I've implemented in Perl. This has been
Using php I'd like to subtract/minus two times; each time within a separate document
I have created a text file in Unix environment using Java code. For writing
I have an Android app that saves a text file directly onto the phone,
I have few columns in an excel sheet for which I need to do
I am trying to set twoway binding on a UserControl that I have created.
I have a stored procedure that is required to update an existing record with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.