ASP
以下內容為程序代碼
<%@ Page Language="C#" %>
檢索浏覽器功能
Boolean ActiveXControls = <%=Request.Browser.ActiveXControls.ToString()%>
Boolean AOL = <%=Request.Browser.AOL.ToString()%>
Boolean BackgroundSounds = <%=Request.Browser.BackgroundSounds.ToString()%>
Boolean Beta = <%=Request.Browser.Beta.ToString()%>
String Browser = <%=Request.Browser.Browser%>
Boolean CDF = <%=Request.Browser.CDF.ToString()%>
Boolean Cookies = <%=Request.Browser.Cookies.ToString()%>
Boolean Crawler = <%=Request.Browser.Crawler.ToString()%>
Boolean Frames = <%=Request.Browser.Frames.ToString()%>
Boolean JavaApplets = <%=Request.Browser.JavaApplets.ToString()%>
Boolean JavaScript = <%=Request.Browser.JavaScript.ToString()%>
Int
Double MinorVersion = <%=Request.Browser.MinorVersion.ToString()%>
String Platform = <%=Request.Browser.Platform%>
Boolean Tables = <%=Request.Browser.Tables.ToString()%>
String Type = <%=Request.Browser.Type%>
Boolean VBScript = <%=Request.Browser.VBScript.ToString()%>
String Version = <%=Request.Browser.Version%>
Boolean Win
Boolean Win
<%=Request.Browser.Win32.ToString()%>除了如上所示訪問配置設置外
以下內容為程序代碼
CustomConfigSettings config = (CustomConfigSettings) ConfigurationSettings[
if (config
// Do something here
}
Dim config As CustomConfigSettings = CType(ConfigurationSettings(
CustomConfigSettings)
If config
End If
var config:CustomConfigSettings = CustomConfigSettings(ConfigurationSettings[
;
if (config
// Do something here
}
使用應用程序設置
配置文件非常適合存儲自定義應用程序設置
/>
ConfigurationSettings 對象公開一個特殊的 AppSettings 屬性
以下內容為程序代碼
String dsn = ConfigurationSettings
Dim dsn As String = ConfigurationSettings
var dsn:String = ConfigurationSettings
以下內容為程序代碼
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>檢索配置數據
BackColor=
BorderColor=
ShowFooter=
CellPadding=
CellSpacing=
Font
Font
HeaderStyle
/>
From:http://tw.wingwit.com/Article/program/net/201311/13970.html