Sign in to follow this  
Followers 0
Chinasmoker

About filewrite

1 post in this topic

i ve a script that needs to modify a file,and this file needs to open as a text ,

The name of this file is 'systemconfig.properties'

follow is this file

CODE
//\u8d44\u4ea7\u7ba1\u7406\u542f\u52a8\u914d\u7f6e On\u4e3a\u542f\u52a8 Off\u4e3a\u4e0d\u542f\u52a8

AssetOnOff=On

SupportES=Off

question : i need to modify 'AssetOnOff=On' to'AssetOnOff=Off' ,but i cannt find a suitable function

follow my script

CODE
$reg = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Hintsoft\PubwinServer","basedir");get the path of this file

$file = FileOpen ($reg &"\appServ\server\webapps\NetCafe\WEB-INF\classes\systemconfig.properties",0) ;file open

$line1 = FileReadLine ($file,2) ;read the line i need

$line1_spi= StringSplit($line1,"=");split the string as '='

if $line1_spi[2] = "On" Then

$newstrin = StringReplace($line1_spi[2],"On","Off")

EndIf


One is never too old to learn

Share this post


Link to post
Share on other sites



Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0