|
else{ sWidthCSS = sWidth+"px"; }
if(sHeight.IndexOf('%')!=-1){ sHeightCSS = sHeight; } else{ sHeightCSS = sHeight+"px"; }
HttpContext.Current.Response.Write(" { string sAgent = HttpContext.Current.Request.UserAgent; double iVersion; bool iIsCompatible = false; if( sAgent.IndexOf("MSIE") !=-1 && sAgent.IndexOf("mac") ==-1 && sAgent.IndexOf("Opera") == -1) { try{ iVersion = Convert.ToDouble(sAgent.Substring(sAgent.IndexOf("MSIE")+4,4).Trim()); } catch{ iVersion=0; } iIsCompatible = ( iVersion >= 5.5 ); } else { iIsCompatible = false; } return iIsCompatible; }
private string GetConfigFieldString() { string sParams=""; bool bFirst = true; foreach(DictionaryEntry de in oConfig) { if(bFirst == false){ sParams = sParams+"&"; } else{ bFirst = false; } sParams = sParams+EncodeConfig( de.Key.ToString() )+ "=" +EncodeConfig( de.Value.ToString() ); } return sParams; } private string EncodeConfig( string valueToEncode ) { string sEncodeConfig; sEncodeConfig = valueToEncode.Replace("&", "%26" ); sEncodeConfig = sEncodeConfig.Replace("=", "%3D" ); sEncodeConfig = sEncodeConfig.Replace("'", "%22" ); return sEncodeConfig; } } script> 使用方法:
<% string sBasePath = Request.ServerVariables["PATH_INFO"]; FCKeditor oFCKeditor = new FCKeditor(); FCKeditor.BasePath = "./FCKeditor/"; FCKeditor.Width = "100%"; FCKeditor.Height = "400"; FCKeditor.ToolbarSet = "Basic"; FCKeditor.Create("body"); %>
此外,这个编辑器的asp.net用的文件上传和浏览程序也是没有的,不过可以在配置文件里把asp设置为默认脚本语言就行了,一般支持asp.net的服务器都支持asp的,不过asp.net的程序就不可能直接调用asp的类了,因此我编写了这个接口。
(出处:清风网络学院)
上一篇:无需软件 Vista自动更换IP地址
下一篇:修改注册表 缩短Vista响应时间
|