Statement
Stop Update.
Going lidecheng.com
Thanks!
Sybian 手机软件开发环境搭建
附软件下载地址

需要安装的软件是 ActiverPerl / Java Runtime / Carbide.C++ Express / SDK
注意事项:
1> 所有的安装都必须以管理员权限进行,否则一些环境变量将不能得到正确的设置。
2> SDK的安装路径不能有空格
3> 为了环境工作正常,建议将SDK、IDE和工程未见放在同一个逻辑分区上,安装至C盘默认目录即可。
4> 安装顺序为:ActiverPerl → Java Runtime → Carbide.C++ Express → SDK
SDK结构
1、API源文件
SDK包含了在应用程序开发过程中需要使用的Symbian OS 9.1 和S60的API头文件以及库文件
2、开发工具
SDK包含了用于创建应用程序所需文件的众多工具,例如编译工具以及打包工具,从而实现在S60手机上的安装工作等。
3、模拟器
模拟器可以使在将应用程序打包安装到手机上之前,先在PC上面观察和检测应用程序,它提供了图形化接口,可以像使用真正的手机一样测试应用程序。
所需软件的下载地址(08年3月)
S60 Platform SDKs for Symbian OS, for C++
Carbide Development Tools for Symbian OS C++ (Carbide.c++)
另外如果是做S60的界面开发可以选用 Carbide.ui 3.2 Theme Edition
如果你习惯使用Microsoft Visual Studio 2005,可与选用Carbide.vs 。
另外您需要有一个诺基亚论坛(www.forum.nokia.com)的注册ID,这样才能拿到开发工具的Serial number。
说明:
以上仅是我选用的Symbian开发平台。像其他软件或语言一样,它不仅只有一种开发工具,您可以选择NetBean、Eclipse等等……
建议您使用防毒无弹窗的FireFox浏览器,上网冲浪更安全。
有数码相机?有很多图片?使用免费的图片管理软件Picasa,还送1G免费网络相册!
S60 iphone 主题是我最近制作的For Sybian S60手机的一款手机皮肤,本次放出的是第一个版本,此皮肤以后还会在使用过程中不断改进,逐步完善。
本次版本为v0.2,也就是说还不是一个正式版,仅供S60手机玩家试用,本程序在本人的Nokia N73手机上运行稳定,正常。
本程序使用24bit色彩,顾安装程序较大,2.11M,正式版放出后将会提供多个版本安装包下载。
附主题截图:
截图是开发过程中的截图,安装到中文版手机中就是中文界面了






主题下载地址:
| 版 本 | v0.2 测试版 |
| 版权所有 | lidecheng.com |
| 软件平台 | Symbian S60 |
| 整理日期 | 2008年3月3日7:30:59 |
| 软件大小 | 2.11M |
| 下载地址 | 点击下载 |
版本更新信息:
S60 iphone v0.2(2008年3月3日7:21:29):
1、主程序制作完成。
2、修改大多数图标文件为iphone手机图标。
3、制作主题桌面。
4、完善了一些已知错误。
5、加入了一些vista图标元素。
……
跨浏览器支持,仿MSN右下角弹出广告代码,可自动消失,附带关闭按钮
代码:
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<title>先飞电脑技术网</title>
</head>
<Script language=”JavaScript”>
<!–
window.onload = getMsg;
window.onresize = resizeDiv;
window.onerror = function(){}
//短信提示使用(asilas添加)
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function getMsg()
{
try{
divTop = parseInt(document.getElementById(”eMeng”).style.top,10)
divLeft = parseInt(document.getElementById(”eMeng”).style.left,10)
divHeight = parseInt(document.getElementById(”eMeng”).offsetHeight,10)
divWidth = parseInt(document.getElementById(”eMeng”).offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById(”eMeng”).style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
document.getElementById(”eMeng”).style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
document.getElementById(”eMeng”).style.visibility=”visible”
objTimer = window.setInterval(”moveDiv()”,10)
}
catch(e){}
}
function resizeDiv()
{
i+=1
if(i>300) closeDiv() //客户想不用自动消失由用户来自己关闭所以屏蔽这句
try{
divHeight = parseInt(document.getElementById(”eMeng”).offsetHeight,10)
divWidth = parseInt(document.getElementById(”eMeng”).offsetWidth,10)
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
document.getElementById(”eMeng”).style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
document.getElementById(”eMeng”).style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function moveDiv()
{
try
{
if(parseInt(document.getElementById(”eMeng”).style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(objTimer)
objTimer = window.setInterval(”resizeDiv()”,1)
}
divTop = parseInt(document.getElementById(”eMeng”).style.top,10)
document.getElementById(”eMeng”).style.top = divTop - 1
}
catch(e){}
}
function closeDiv()
{
document.getElementById(’eMeng’).style.visibility=’hidden’;
if(objTimer) window.clearInterval(objTimer)
}
–>
</Script>
<!–温馨提示代码开始–>
<DIV id=eMeng style=”BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 116px; BACKGROUND-COLOR: #c9d3f3″>
<TABLE style=”BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid” cellSpacing=0 cellPadding=0 width=”100%” bgColor=#AFDCF3 border=0>
<TBODY>
<TR bgColor=#6699cc>
<TD style=”font-size: 12px; background-image: url(’msgTopBg.gif’); color: #0f2c8c” width=30 height=24></TD>
<TD style=”font-weight: normal; font-size: 12px; background-image: url(’msgTopBg.gif’); color: #ffffff; padding-left: 4px; padding-top: 4px” vAlign=center width=”100%”> 网站温馨提示:</TD>
<TD style=”background-image: url(’msgTopBg.gif’); padding-right: 2px; padding-top: 2px” vAlign=center align=right width=19><span title=关闭 style=”CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;” onclick=closeDiv() >×</span><!–<IMG title=关闭 style=”CURSOR: hand” onclick=closeDiv() hspace=3 src=”msgClose.jpg”>–></TD>
</TR>
<TR>
<TD style=”background-image: url(’http://pic.tianyaclub.com/images/windty_bg.jpg’); padding-right: 1px; padding-bottom: 1px” colSpan=3 height=90>
<DIV style=”BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%”>先飞电脑技术网全新改版,免费精品网络资源,你用了吗?<BR>
<DIV align=center style=”word-break:break-all”><!–<a href=”http://pic.tianyaclub.com/default.asp?idWriter=0&Key=0″ target=”_blank”>–><a href=”http://www.xfbbs.com” target=”_blank”>
<font color=#FF0000>进入网站浏览</font></a></DIV>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<!–温馨提示代码结束–>
</html>
<HTML>
<HEAD>
<TITLE>合同申请</TITLE>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<SCRIPT LANGUAGE = JavaScript>
/** Define object Dsy 构造器
fieldValues - 三个表单域的名称, 可以通过 request.getParameter(xxx) 取值
defalutOptions - 默认选项
*/
function Dsy(fieldValues, defalutOptions){
this.Items = {};
this.defalutOptions = defalutOptions;// 默认选项
this.fieldValues = fieldValues;// 三个表单域的名称
}Dsy.prototype.add = function(id, iArray){
this.Items[id] = iArray;
}Dsy.prototype.Exists = function(id){
if (typeof(this.Items[id]) == “undefined”)
return false;
return true;
};Dsy.prototype.setup = function() {
this.bean_change(0);
}// This prototype method added by BeanSoft Studio
Dsy.prototype.bean_change = function(v){
var str = “0″;
for (i = 0; i < v; i++){
str += (”_” + (document.getElementById(this.fieldValues[i]).selectedIndex - 1));
};var ss = document.getElementById(this.fieldValues[v]);
// Avoid a null exception
if(ss == null) return;with(ss){
length = 0;
options[0] = new Option(this.defalutOptions[v], this.defalutOptions[v]);
if (v && document.getElementById(this.fieldValues[v - 1]).selectedIndex > 0 || !v){
if (this.Exists(str)){
array = this.Items[str];
for (i = 0; i < array.length; i++)
options[length] = new Option(array[i], array[i]);
if (v)
options[1].selected = true;
}
}if (++v < s.length){
this.bean_change(v);
}
}
}function change(v){
dsy.bean_change(v);// Call test prototype
}// Write form data string, 输出表单脚本代码
// dsy, object name
// varName, 变量名
function toString(dsy, varName) {
var str = “”;
for(i = 0; i < dsy.fieldValues.length; i++) {
str += “<select id=\”" + dsy.fieldValues[i] + “\” onChange=\”" + varName + “.bean_change(” + (i + 1)
+ “);\”></select>\r\n”;
}
str += “<br/>”;
return str;
}// 第一个对象
var dsy = new Dsy([”s1″, “s2″, “s3″], [”销售方名称”, “销售方联系人”, “联系电话”]);
var dsy1 = new Dsy([”s4″, “s5″, “s6″], [”最终用户名称”, “最终用户联系人”, “联系电话”]);
var dsy2 = new Dsy(s = [”s7″, “s8″, “s9″], [”厂商”, “厂商销售”, “联系电话”]);// 填入数据, 重复的代码
dsy.add(”0″, [”亚信”, “航天理想”]);dsy.add(”0_0″, [”亚信联系人_1″, “亚信联系人_2″]);
dsy.add(”0_0_0″, [”亚信联系人_1联系电话”]);
dsy.add(”0_0_1″, [”亚信联系人_2联系电话”]);dsy.add(”0_1″, [”航天理想联系人_1″, “航天理想联系人_2″]);
dsy.add(”0_1_0″, [”航天理想联系人_1联系电话”]);
dsy.add(”0_1_1″, [”航天理想联系人_2联系电话”]);dsy1.add(”0″, [”最终用户1″, “最终用户2″]);
dsy1.add(”0_0″, [”最终用户1_联系人1″, “最终用户1_联系人2″]);
dsy1.add(”0_0_0″, [”最终用户1_联系人1_电话”]);
dsy1.add(”0_0_1″, [”最终用户1_联系人2_电话”]);dsy1.add(”0_1″, [”最终用户2_联系人1″, “最终用户2_联系人2″]);
dsy1.add(”0_1_0″, [”最终用户2_联系人1_电话”]);
dsy1.add(”0_1_1″, [”最终用户2_联系人2_电话”]);dsy2.add(”0″, [”BEA”, “Horizon”]);
dsy2.add(”0_0″, [”张学友”, “BeanSoft”]);
dsy2.add(”0_0_0″, [”1234567890″]);
dsy2.add(”0_0_1″, [”beansoft@126.com”]);dsy2.add(”0_1″, [”AAA”, “BBB”]);
dsy2.add(”0_1_0″, [”AAA_99999″]);
dsy2.add(”0_1_1″, [”bbb_88888″]);function setup(){ // Initialize the object
dsy.setup(); //依次调用 setup
dsy1.setup();
dsy2.setup();
}function prints1(){
alert(document.frm.s1.value + ” ” + document.frm.s2.value + ” ” + document.frm.s3.value +”\r\n”);
}//isNaN()检查运算结果 http://tech.ccidnet.com/pub/article/c1115_a120997_p1.html
</SCRIPT>
</head>
<body bgcolor=”#E0E0E0″ onload=”setup()”>
多级关联菜单:
<form name=”frm”><!– 方式1: 手工输出 HTML 代码, 便于排版
<select id=”s1″ onChange=”dsy.bean_change(1);”></select>
<select id=”s2″ onChange=”dsy.bean_change(2);”></select>
<select id=”s3″ onChange=”dsy.bean_change(3);”></select>
<br>
<br>
<br>
<select id=”s4″ onChange=”dsy1.bean_change(1);”></select>
<select id=”s5″ onChange=”dsy1.bean_change(2);”></select>
<select id=”s6″ onChange=”dsy1.bean_change(3);”></select>
<br>
<br>
<br>
<select id=”s7″ onChange=”dsy2.bean_change(1);”></select>
<select id=”s8″ onChange=”dsy2.bean_change(2);”></select>
<select id=”s9″ onChange=”dsy2.bean_change(3);”></select>
–>
<SCRIPT LANGUAGE=”JavaScript”>
<!–
// 方式2: 脚本输出表单 HTML 代码, 代码和上面注释掉的类似
document.write(toString(dsy, “dsy”));
document.write(toString(dsy1, “dsy1″));
document.write(toString(dsy2, “dsy2″));
//–>
</SCRIPT><input type=button name=b1 value=”监测” onclick=”prints1()”>
</form>
</body>
</html>
原文地址:http://www.blogjava.net/beansoft/archive/2007/10/22/154898.html
在DreamHost的虚拟主机中设置404等错误页面,可以用.htaccess文件实现。
打开记事本,写入以下代码:
ErrorDocument 404 /404.html
保存成.htaccess文件上传到网站的根目录。
/404.html是目录名和文件名,可以改成自己的想要的名字,比如把所有错误页面放在一个文件夹 ../domainName/ErrorPage/404.html
.htaccess简单介绍和应用
Part 1 – Introduction介绍
Introduction 介绍
In this tutorial you will find out about the .htaccess file and the power it has to improve your website. Although .htaccess is only a file, it can change settings on the servers and allow you to do many different things, the most popular being able to have your own custom 404 error pages. .htaccess isn't difficult to use and is really just made up of a few simple instructions in a text file.
从本指南中,您可以学习到有关.htaccess文档及其功能,用以优化您的网站。尽管.htaccess只是一个文档,但它可以更改服务器的设置,允许您做许多不同的事情,最流行的功能是您可以创建自定义的“404 error”页面。.htaccess 并不难于应用,只是在一个text文档中添加几条简单的指令而已。
Will My Host Support It? 我的主机支持它吗?
This is probably the hardest question to give a simple answer to. Many hosts support .htaccess but don't actually publicise it and many other hosts have the capability but do not allow their users to have a .htaccess file. As a general rule, if your server runs Unix or Linux, or any version of the Apache web server it will support .htaccess, although your host may not allow you to use it.
这可能很难用简单的答案来回答。许多主机支持.htaccess但实际上并不会明确声明,许多其他类型的主机有能力但并不允许他们的用户使用. htaccess文档。作为一般性的规则,如果你的主机使用Unix或Linux系统,或任何版本的Apache网络服务器,它一般来说是支持. htaccess的,尽管你的主机服务器可能不允许你使用它。
A good sign of whether your host allows .htaccess files is if they support password protection of folders. To do this they will need to offer .htaccess (although in a few cases they will offer password protection but not let you use .htaccess). The best thing to do if you are unsure is to either upload your own .htaccess file and see if it works or e-mail your web host and ask them.
你的主机是否允许.htaccess,很好的一个标志是它是否支持文件夹的密码保护。为此,他们将提供.htaccess支持(尽管少数情况下他们提供密码保护功能但不允许你使用.htaccess)。如果你不确定,最好的办法一是上传你自己的.htaccess文档看看是否有用,二是e-mail给你的主机服务商询问。
What Can I Do? 我该怎么做?
You may be wondering what .htaccess can do, or you may have read about some of its uses but don't realise how many things you can actually do with it.
你可能疑惑.htaccess到底能做些什么,或者你可能曾知道它的一些功能但并不真正了解你实际到底可以用它来做多少事情。
There is a huge range of things .htaccess can do including: password protecting folders, redirecting users automatically, custom error pages, changing your file extensions, banning users with certian IP addresses, only allowing users with certain IP addresses, stopping directory listings and using a different file as the index file.
.htaccess可以做大量范围的事情,包括:文件夹密码保护、用户自动重新指向、自定义错误页面、变更你的文件扩展名、屏蔽特定的用户IP地址、只允许特定的IP地址、停止目录表以及使用其他文件作为index文件。
Creating A .htaccess File 创建一个.htaccess文档
Creating a .htaccess file may cause you a few problems. Writing the file is easy, you just need enter the appropriate code into a text editor (like notepad). You may run into problems with saving the file. Because .htaccess is a strange file name (the file actually has no name but a 8 letter file extension) it may not be accepted on certain systems (e.g. Windows 3.1). With most operating systems, though, all you need to do is to save the file by entering the name as:
创建.htaccess文档也许会给你带来几个问题。写文档很容易,你只需要在文字编缉器(例如:写字板)里写下适当的代码。然后,你可能会遇到保存文档的困难,因为.htaccess是一个古怪的文件名(文档事实上没有文件名,只有一个由8个字母组成的扩展名),一些系统(例如windows 3.1)无法接受这样的文件名。在大多数的操作系统中,你需要做的是将文档保存成名为:
".htaccess"
(including the quotes). If this doesn't work, you will need to name it something else (e.g. htaccess.txt) and then upload it to the server. Once you have uploaded the file you can then rename it using an FTP program.
(包括引号)。如果这也不行,你需要将其命名为其他的名字(例如htaccess.txt),再将其上传到服务器上,此后你就可以利用FTP软件来重命名它了。
Warning 警告
Before beginning using .htaccess, I should give you one warning. Although using .htaccess on your server is extremely unlikely to cause you any problems (if something is wrong it simply won't work), you should be wary if you are using the Microsoft FrontPage Extensions. The FrontPage extensions use the .htaccess file so you should not really edit it to add your own information. If you do want to (this is not recommended, but possible) you should download the .htaccess file from your server first (if it exists) and then add your code to the beginning.
在使用.htaccess之前,我必须给你一些警告。尽管在服务器上使用.htaccess绝对不太可能给你带来任何麻烦(如果有些东西错了,它只是没效用罢了),但如果你使用Microsoft FrontPage Extensions你就需要小心些。FrontPage Extensions使用了.htaccess,因此你不能编辑它,加入你自己的信息。如果你需要(并不推荐,但是可能)你应该先从服务器上下载. htaccess文档(如果存在),之后在前面加上你的代码。
Custom Error Pages 自定义错误页
The first use of the .htaccess file which I will cover is custom error pages. These will allow you to have your own, personal error pages (for example when a file is not found) instead of using your host's error pages or having no page. This will make your site seem much more professional in the unlikely event of an error. It will also allow you to create scripts to notify you if there is an error (for example I use a PHP script on Free Webmaster Help to automatically e-mail me when a page is not found).
我想介绍的.htaccess第一个应用是自定义错误页面,这使得你可以拥有自己的、个性化的错误页面(例如找不到文件时),而不是你的服务商提供的错误页或没有任何页面。这会让你的网站在出错的时候看上去更加专业。你还可以利用脚本程序在发生错误的时候通知你(例如我使用Free Webmaster Help的PHP脚本程序,当找不到页面的时候自动e-mail给我)。
You can use custom error pages for any error as long as you know its number (like 404 for page not found) by adding the following to your .htaccess file:
任何你知道代码的错误(像404找不到页面),你都可以将其变成自定义页面,要做的只是在.htaccess文件里加入以下一段:
ErrorDocument errornumber /file.html
For example if I had the file notfound.html in the root direct
ory of my site and I wanted to use it for a 404 error I would use:
例如,如果我的根目录下有一个nofound.html文档,我想使用它作为404 error的页面:
ErrorDocument 404 /notfound.html
If the file is not in the root directory of your site, you just need to put the path to it:
如果文件不在网站的根目录下,你只需要把路径设置为:
ErrorDocument 500 /errorpages/500.html
These are some of the most common errors:
以下是一些最常用的错误:
401 - Authorization Required
400 - Bad request
403 - Forbidden
500 - Internal Server Error
404 - Wrong page
Then, all you need to do is to create a file to display when the error happens and upload it and the .htaccess file.
这样,你要做的只是生成一个错误显示文档,然后把它们上传。
Part 2 - .htaccess 命令
Introduction 介绍
In the last part I introduced you to .htaccess and some of its useful features. In this part I will show you how to use the .htaccess file to implement some of these.
上一部分中我已经将你引入了.htaccess以及它的一些有用的功能,在这一部分里,我将向您演示如何应用.htaccess文档去实现这些功能。
Stop A Directory Index From Being Shown 停示显示目录索引
Sometimes, for one reason or another, you will have no index file in your directory. This will, of course, mean that if someone types the directory name into their browser, a full listing of all the files in that directory will be shown. This could be a security risk for your site.
有些时候,由于某种原因,你的目录里没有index文件,当然这样意味着如果有人在浏览器地址栏键入了该目录的路径,该目录下所有的文件都会显示出来,这造成了网站的安全威胁。
To prevent against this (without creating lots of new 'index' files, you can enter a command into your .htaccess file to stop the directory list from being shown:
为了避免这种情况(而不必创建一堆的新index文档),你可以在你的.htaccess文档中键入以下命令,用以阻止目录索引的显示:
Options -Indexes
Deny/Allow Certian IP Addresses 阻止/允许特定的IP地址
In some situations, you may want to only allow people with specific IP addresses to access your site (for example, only allowing people using a particular ISP to get into a certian directory) or you may want to ban certian IP addresses (for example, keeping disruptive memembers out of your message boards). Of course, this will only work if you know the IP addresses you want to ban and, as most people on the internet now have a dynamic IP address, so this is not always the best way to limit usage.
有些情况下,你可能只想允许某些特定IP的用户可以访问你的网站(例如:只允许使用特定ISP的用户进入某个目录),或者你想拦截某些特定的IP地址(例如:将低级用户隔离于你的信息面版外)。当然,这只在你知道你想拦截的IP地址时才有用,然而现在网上的大多数用户都使用动态IP地址,所以这并不是限制使用的常用方法。
You can block an IP address by using:
你可以使用以下命令拦截一个IP地址:
deny from 000.000.000.000
where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will block a whole range.
被拦截的IP地址则为000.000.000.000,如果你只指定其中1或2个代码组,你可以拦截整个区域的地址。
You can allow an IP address by using:
你可以使用以下命令允许一个IP地址的访问:
allow from 000.000.000.000
where 000.000.000.000 is the IP address. If you only specify 1 or 2 of the groups of numbers, you will allow a whole range.
被允许的IP地址则为000.000.000.000,如果你只指定其中1或2个代码组,你可以允许整个区域的地址。
If you want to deny everyone from accessing a directory, you can use:
如果你想阻止所有人访问该文件目录,你可以使用:
deny from all
but this will still allow scripts to use the files in the directory.
但这将仍然允许脚本程序使用这个目录下的文档。
Alternative Index Files 替代的index文档
You may not always want to use index.htm or index.html as your index file for a directory, for example if you are using PHP files in your site, you may want index.php to be the index file for a directory. You are not limited to 'index' files though. Using .htaccess you can set foofoo.blah to be your index file if you want to!
也许你不想一直使用index.htm或index.html来作为目录的索引文档,例如你的站点使用PHP文档,你会想使用 index.php来作为该目录的索引文档。当然也不必局限于“index”文档,如果你愿意,你尽管使用foofoo.balh来作为你的索引文档!
Alternate index files are entered in a list. The server will work from left to right, checking to see if each file exists, if none of them exisit it will display a directory listing (unless, of course, you have turned this off).
替代的索引文档可以排成一个列表,服务器会从左至右进行寻找,看看哪个文档在真实的目录中存在。如果一个也找不到,它将会把目录清单显示出来(当然除非你关闭了显示目录文件清单)。
DirectoryIndex index.php index.php3 messagebrd.pl index.html index.htm
Redirection 重新指向
One of the most useful functions of the .htaccess file is to redirect requests to different files, either on the same server, or on a completely different web site. It can be extremely useful if you change the name of one of your files but allow users to still find it. Another use (which I find very useful) is to redirect to a longer URL, for example in my newsletters I can use a very short URL for my affiliate links. The following can be done to redirect a specific file:
.htaccess其中一个极其有用的功能,就是将请求重新指向站内或站外的不同文档。当你改变了一个文档名称时但仍然想让用户仍然可以用旧链接找到它,这个时候此功能将变得极其有用。另一个应用(我发现的很有用的)是重新指向一个长URL,例如在我的时事信息中,我可以使用一个很简短的URL来指向我的联合链接。以下是一个重新指向特定文档的例子:
Redirect /location/from/root/file.ext http://www.othersite.com/new/file/location.xyz
In this above example, a file in the root directory called oldfile.html would be entered as:
上述的例子中,访问在root目录下的名为oldfile.html可以键入:
/oldfile.html
and a file in the old subdirectory would be entered as:
访问一个旧次级目录中的文件可以键入:
/old/oldfile.html
You can also redirect whole directoires of your site using the .htaccess file, for example if you had a directory called olddirectory on your site and you had set up the same files on a new site at: http://www.newsite.com/newdirectory/ you could redirect all the files in that directory without having to specify each one:
你也可以使用.htaccess将整个网站的目录都做重新指向,假如你的网站上有一个名为olddirectory的目录,并且你已经在一个新网站http://www.newsite.com/newdirectory/上建立了与上相同的文档,你可以将旧目录下所有的文件做一次重新指向而不必一一声明:
Redirect /olddirectory http://www.newsite.com/newdirectory
Then, any request to your site below /olddirectory will bee redirected to the new site, with the
extra information in the URL added on, for example if someone typed in:
这样,任何指向到站点中/olddirectory的请求都将被重新指向新的站点,包括附加的额外URL信息。例如有人键入:
http://www.youroldsite.com/olddirecotry/oldfiles/images/image.gif
They would be redirected to:
请求将被重新指向到:
http://www.newsite.com/newdirectory/oldfiles/images/image.gif
This can prove to be extremely powerful if used correctly.
如果正确使用,本功能将极其强大。
Part 3 – 密码保护
Introduction 介绍
Although there are many uses of the .htaccess file, by far the most popular, and probably most useful, is being able to relaibly password protect directories on websites. Although JavaScript etc. can also be used to do this, only .htaccess has total security (as someone must know the password to get into the directory, there are no 'back doors')
尽管有各种各样的.htaccess用法,但至今最流行的也可能是最有用的做法是将其用于网站目录的可靠的密码保护。尽管JavaScrip等也能做到,但只有.htaccess具有完美的安全(即访问者必须知晓密码才可以访问目录,并且绝无“后门”可走)。
The .htaccess File
Adding password protection to a directory using .htaccess takes two stages. The first part is to add the appropriate lines to your .htaccess file in the directory you would like to protect. Everything below this directory will be password protected:
利用.htaccess将一个目录加上密码保护分两个步骤。第一步是在你的.htaccess文档里加上适当的几行代码,再将.htaccess文档放进你要保护的目录下:
AuthName "Section Name"
AuthType Basic
AuthUserFile /full/path/to/.htpasswd
Require valid-user
There are a few parts of this which you will need to change for your site. You should replace "Section Name" with the name of the part of the site you are protecting e.g. "Members Area".
有几个小部分你可能需要根据你的网站情况而修改一下。用被保护部分的名字替换掉”Section Name”,例如"Members Area"。
The /full/parth/to/.htpasswd should be changed to reflect the full server path to the .htpasswd file (more on this later). If you do not know what the full path to your webspace is, contact your system administrator for details.
另外/full/parth/to/.htpasswd 应该替换为指向.htpasswd文档(后面详述该文档)的完整服务器路径。如果你不知道你网站空间的完整路径,询问一下你的系统管理员。
The .htpasswd File
Password protecting a directory takes a little more work than any of the other .htaccess functions because you must also create a file to contain the usernames and passwords which are allowed to access the site. These should be placed in a file which (by default) should be called .htpasswd. Like the .htaccess file, this is a file with no name and an 8 letter extension. This can be placed anywhere within you website (as the passwords are encrypted) but it is advisable to store it outside the web root so that it is impossible to access it from the web.
目录的密码保护比.htaccess的其他功能要麻烦些,因为你必须同时创建一个包含用户名和密码的文档,用于访问你的网站,相关信息(默认)应位于一个名为.htpasswd的文档里,像.htaccess一样,.htpasswd也是一个没有文件名且具有8位扩展名的文档,可以放置在你网站里的任何地方(此时密码应加密),但建议你将其保存在网站根目录外,这样通过网络就无法访问到它了。
Entering Usernames And Passwords 输入用户名和密码
Once you have created your .htpasswd file (you can do this in a standard text editor) you must enter the usernames and passwords to access the site. They should be entered as follows:
创建好.htpasswd文档后(可以通过文字编辑器创建),下一步是输入用于访问网站的用户名和密码,应为:
username:password
where the password is the encrypted format of the password. To encrypt the password you will either need to use one of the premade scripts available on the web or write your own. There is a good username/password service at the KxS site which will allow you to enter the user name and password and will output it in the correct format.
“password”的位置应该是加密过的密码。你可以通过几种方法来得到加密过的密码:一是使用一个网上提供的permade脚本或自己写一个;另一个很不错的username/password加密服务是通过KxS网站,这里允许你输入用户名及密码,然后生成正确格式的密码。
For multiple users, just add extra lines to your .htpasswd file in the same format as the first. There are even scripts available for free which will manage the .htpasswd file and will allow automatic adding/removing of users etc.
对于多用户,你只需要在.htpasswd文档中新增同样格式的一行即可。另外还有一些免费的脚本程序可以方便地管理.htpasswd文档,可以自动新增/移除用户等。
Accessing The Site 访问网站
When you try to access a site which has been protected by .htaccess your browser will pop up a standard username/password dialog box. If you don't like this, there are certain scripts available which allow you to embed a username/password box in a website to do the authentication. You can also send the username and password (unencrypted) in the URL as follows:
当你试图访问被.htaccess密码保护的目录时,你的浏览器会弹出标准的username/password对话窗口。如果你不喜欢这种方式,有些脚本程序可以允许你在页面内嵌入username/password输入框来进行认证,你也可以在浏览器的URL框内以以下方式输入用户名和密码(未加密的):
http://username:password@www.website.com/directory/
Summary 小结
.htaccess is one of the most useful files a webmaster can use. There are a wide variety of different uses for it which can save time and increase security on your website.
.htaccess是一个站点管理员可以应用的一个强大的工具,有更多的变化以适应不同的用途,可以节约时间及提高网站的安全性。
li的这个样式定义是将列表项目使用图片来代替显示的小圆点。
当然也可以显示成其它效果,详细请参阅下面的定义:
列表项目效果的CSS定义
| *list-style-type:circle | 列表项目样式 |
| disc:CSS1 | 实心圆 |
| circle:CSS1 | 空心圆 |
| square:CSS1 | 实心方块 |
| decimal:CSS1 | 阿拉伯数字 |
| lower-roman:CSS1 | 小写罗马数字 |
| upper-roman:CSS1 | 大写罗马数字 |
| lower-alpha:CSS1 | 小写英文字母 |
| upper-alpha:CSS1 | 大写英文字母 |
| none:CSS1 | 不使用项目符号 |
| armenian:CSS2 | 传统的亚美尼亚数字 |
| cjk-ideographic:CSS2 | 浅白的表意数字 |
| georgian:CSS2 | 传统的乔治数字 |
| lower-greek:CSS2 | 基本的希腊小写字母 |
| hebrew:CSS2 | 传统的希伯莱数字 |
| hiragana:CSS2 | 日文平假名字符 |
| hiragana-iroha:CSS2 | 日文平假名序 |
| katakana:CSS2 | 日文片假名字符 |
| katakana-iroha:CSS2 | 日文片假名序号 |
| lower-latin:CSS2 | 小写拉丁字母 |
| upper-latin:CSS2 | 大写拉丁字母 |
| list-style-image: url(图片地址) | 用图像disc.gif代替列表项目显示 |
| list-style-position : outside | inside |
| outside | 列表项目标记放置在文本以外,且环绕文本不根据标记对齐 |
| inside | 列表项目标记放置在文本以内,且环绕文本根据标记对齐 |
代码大全(第二版)的译者金戈有关他的译著的一段录像,昨天晚上在china-pub看到的,看过之后颇有收获,上传到youtube分享一下:
代码大全真的是一本非常好的著作,前几天也入手一本,虽然还没有足够的功力领悟其精髓,但是简略读了几段,也是受益匪浅,如果你也是一个programmer,建议你也入手一本,像金戈说的一样最好读英文影印版,如果你英文也是欠佳,那就跟我一起读中文版吧。
最近两天在读李烨的《别具光芒:DIV+CSS网页布局与美化》,收益颇深,回想以前从来没有认真读过html标准,真是不屑于这些标准,导致了对页面的控制能力不强,现在借助这本书重读html标准,有很多收货,比如最平常的图片引用
,以前以为很多标签是没有用的,src上图片地址就草草结束了,直到读了《别具光芒:DIV+CSS网页布局与美化》
, 才知道alt的作用:alt属性制定了当图片不能显示时就显示供替换文本,这样做对正常的用户可有可无,但对纯文本浏览器和使用屏幕阅读机的用户来说是至 关重要的,而且在图片丢失的情况下还可以用过alt值来替代图片。只有添加了alt属性,代码才会被w3c正确性校验通过。
转回正题: xhtml和html之间的区别
xhtml和html之间的区别
1、选择DTD定义文档的类型
doctype是document type(文档类型)的简写,用来说明文件用的xhtml或者是html是什么版本。在xhtml中必须生命文档的类型,以便于浏览器知道正浏览的文档是什么类型的,而且声明部分要加载文档head之前。
需要注意的是:COCTYPE声明不是xhtml文档的一部分,也不是文档的一个元素,所以没必要加上结束标签。
要建立符合标准的网页,DOCTYPE生命是必不可少的关键组成部分;除非为xhtml确定了一个正确的DOCTYPE,否则表示和css都不会生效。
xhtml1.0 提供了以下3种DTD声明可供选择:
2、设定一个名字空间(Namespace)
一个名字空间是收集元素类型和属性名字的一个详细的DTD,名字空间生命允许通过一个在线地址指来识别名字空间。
3、定义了语言编码
为了被浏览器正确解释和通过标识校验,所有的xhtml文档都必须生命他们所使用的编码语言。
4、xhtml元素一定要呗正确的嵌套使用
在html里一些元素可以不正确嵌套也能正常显示,而在xhtml必须要正确嵌套之后才能正常使用。
5、xhtml文件一定要有正确的组织结构
所有的xhtml应该正确的嵌套在以开始,以结束的元素里面,其他的元素可以有子元素,并且子元素也要呗正确的嵌套在他们的父元素内。
6、标签名字一定要用小写字母
因为xhtml文档是xml的一中,而xml对大小写是敏感的,像
和
是两个不同的标记
7、所有的xhtml元素一定要关闭
不懂有没有关闭的空元素存在于代码中。
8、属性名字必须小写
属性和标签的要求一样,要小写。
9、属性值必须带上英文双引号
属性的值需要用英文双引号括起来
10、属性的简写被禁止
在html中某些属性可以简写,但是在xhml中不能简写。
11、用id属性代替name属性
html4.01 中为a\applet\frame\iframe\img和map定义了一个name属性,在xhtml里除了表单(form)外,name属性不能使用,应该用id来替换。
12、lang属性
lang属性可以应用于几乎所有的xhml元素,他制定了元素中内容的语言属性,如果在一个元素中应用lang属性,必须加上xml:lang属性。
Microsoft is making source code for the .Net Framework available to interested developers under its Shared Source license, the company announced on October 3.
Microsoft will be rolling out the .Net code piecemeal, after scrubbing comments. It plans to start with the .Net Base Class Libraries, ASP.Net, Windows Forms, ADO.Net, XML (System.XML) and the Windows Presentation Foundation, blogged Microsoft Developer Division General Manager Scott Guthrie. Over time, the company also plans to make available the source code for Windows Communication Foundation, Windows Workflow Foundation and Language Integrated Query (LINQ), Guthrie said.
Microsoft is releasing the code under the Microsoft Reference License (MS-RL), one of several different Shared Source licenses the company offers. Interestingly, MS-RL is one of the licenses that Microsoft decided against submitting to the Open Standards Initiative (OSI) for consideration as a bona fide open-source license. (Microsoft submitted its Microsoft Permissive License, MS-PL, and the Microsoft Community License, MS-CL, for OSI approval in August.)
Microsoft intentionally decided on a license that doesn’t allow changes to or redistribution of the source code because it doesn’t want the .Net Framework to be a moving target, explained Dino Chiesa, Director of the .NET Platform.
“There’s still a value in having a reliable, dependable platform,” Chiesa said. “We don’t want developers making mods to it.”
Microsoft is positioning its move as a way to help .Net developers who need to understand the inner workings of the framework to write better apps.
“Releasing source code can be a help in debugging,” agreed Greg DeMichillie, an analyst with Directions on Microsoft. “Sometimes a developer can’t figure out why their app isn’t but if they can step From their application into the library it becomes clear.
However, DeMichillie said, Microsoft “should have done this a long time ago. In fact, Microsoft debated this very question back in 2000, before the initial release of .NET but they thought that publishing the code, even as read-only, was too risky,
presumably because of IP (intellectual property) issues. So it’s nice they are getting around to this, but what would have been pretty bold seven years ago is pretty ho-hum now.”
But Andrew Brust, Chief of New Technology at twentysix New York (and a Microsoft-appointed Regional Director) said Microsoft also gets another benefit From publishing the .Net source code.
“Even more significant is the apparent regime of transparency and general liberalism that is taking root in the dev div (Moonlight on Linux is another example). I think they are realizing that such an approach is a hearts/minds winner and the downside is very low. If you love people (developers, in this case), set them free. I think that’s good advice, and good business.”
Microsoft will allow developers to download the .NET Framework source libraries via a standalone install,” allowing you to use any text editor to browse it locally,” Microsoft’s Guthrie explained. “We will also provide integrated debugging support of it within VS 2008,” which is slated to go to manufacuring by the end of 2007.
While Microsoft isn’t requiring developers to sign any non-disclosure agreements to view the .Net source code, I’m sure anyone working on an open-source project would need to think twice about looking at Microsoft’s code in order to avoid potential IP conflicts.
Any developers out there interested in looking at the .Net Framework code? Why or why not?
Form All about Microsoft