Best way to handle huge strings in c#

Posted by srk on Stack Overflow See other posts from Stack Overflow or by srk
Published on 2010-05-31T07:55:42Z Indexed on 2010/05/31 8:02 UTC
Read the original article Hit count: 360

Filed under:

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

© Stack Overflow or respective owner

Related posts about c#