我用request.querystring获取的字体串是乱码,但我把web.config里面的UTF-8改为GB2312后一直报这样的错误:Server Error in '/' Application.
--------------------------------------------------------------------------------Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The data at the root level is invalid. Line 1, position 40.Source Error:
Line 1: <?xml version="1.0" encoding="gb2312"?>
Line 2: <configuration>
Line 3: <system.web>
这是为何?
--------------------------------------------------------------------------------Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The data at the root level is invalid. Line 1, position 40.Source Error:
Line 1: <?xml version="1.0" encoding="gb2312"?>
Line 2: <configuration>
Line 3: <system.web>
这是为何?
有可能要用Server.Urlencode(string)编码啊
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation defaultLanguage="C#" debug="false"/>
<customErrors mode="Off"/>
</system.web>
<appSettings>
<!--数据库连接串-->
<add key="conn" value="server=localhost;user=sa;pwd=123;database=myaspx" />
<add key="sitetitle" value="ASPX从现在做起!" />
</appSettings>
</configuration>
<configuration>
<system.web>
<compilation defaultLanguage="C#" debug="false"/>
<customErrors mode="Off"/>
</system.web>
<appSettings>
<!--数据库连接串-->
<add key="conn" value="server=localhost;user=sa;pwd=123;database=myaspx" />
<add key="sitetitle" value="ASPX从现在做起!" />
</appSettings>
</configuration>