代码
public
string
writeStr(
string
oldStr)
{
// oldStr=oldStr.Replace("''","'");
oldStr = oldStr.Replace( " " , " " );
oldStr = oldStr.Replace( " < " , " < " );
oldStr = oldStr.Replace( " > " , " > " );
oldStr = oldStr.Replace( " <br/> " , " \n " );
oldStr = oldStr.Replace( " " , " \t " );
oldStr = oldStr.Replace( " " " , " \ "" );
return oldStr;
}
public string readStr( string oldStr)
{
// oldStr=oldStr.Replace("'","''");
oldStr = oldStr.Replace( " " , " " );
oldStr = oldStr.Replace( " < " , " < " );
oldStr = oldStr.Replace( " > " , " > " );
oldStr = oldStr.Replace( " \n " , " <br/> " );
oldStr = oldStr.Replace( " \t " , " " );
oldStr = oldStr.Replace( " \ "" , " & quot; " );
return oldStr;
}
{
// oldStr=oldStr.Replace("''","'");
oldStr = oldStr.Replace( " " , " " );
oldStr = oldStr.Replace( " < " , " < " );
oldStr = oldStr.Replace( " > " , " > " );
oldStr = oldStr.Replace( " <br/> " , " \n " );
oldStr = oldStr.Replace( " " , " \t " );
oldStr = oldStr.Replace( " " " , " \ "" );
return oldStr;
}
public string readStr( string oldStr)
{
// oldStr=oldStr.Replace("'","''");
oldStr = oldStr.Replace( " " , " " );
oldStr = oldStr.Replace( " < " , " < " );
oldStr = oldStr.Replace( " > " , " > " );
oldStr = oldStr.Replace( " \n " , " <br/> " );
oldStr = oldStr.Replace( " \t " , " " );
oldStr = oldStr.Replace( " \ "" , " & quot; " );
return oldStr;
}
在提交文章的时候把换行符Convert.ToString((char)13) + Convert.ToString((char)10)替换成HTML代码</P>、<BR>什么的