<?php
$lang['commonName']='功能';
?>
使用
<table>
<tr>
<td width="125px;"><strong>{lang commonName}</strong></td>
</tr>
请问c#中有类似于改功能的用法吗

解决方案 »

  1.   

    <?php
    $lang['commonName']='功能';
    ?>
    是一个公用的文件,可以在任何页面引用,这样改程序的时候只需要改这一处就可以了
      

  2.   

    本帖最后由 net_lover 于 2012-09-29 10:53:22 编辑
      

  3.   

    都一样 的
    例子
    <%@ Page Language="C#" AutoEventWireup="true" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server"> 
      public Hashtable ht = new Hashtable();
      public System.Collections.Generic.Dictionary<String, String> ht2 = new System.Collections.Generic.Dictionary<string, string>();
      protected void Page_Load(object sender, EventArgs e)
      {
        ht.Add("commonName", "功能1");
        ht2.Add("commonName", "功能2");
        ht["xx"] = "test1";
        ht2["xx"] = "test2";
      }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
      <title>无标题页</title>
    </head>
    <body>
      <form id="form1" runat="server">
      <%=ht["commonName"]%>
      <%=ht2["commonName"]%>
      <%=ht["xx"]%>
      <%=ht2["xx"]%>
      </form>
    </body>
    </html>
      

  4.   

    HashTable是没有强类型的字典,Dictionary是.NET 2.0后支持泛型的字典
    如果仅是普通字典需要Dictionary就可以满足如果还需要通过索引值访问字典用OrderedDictionary,可惜没有泛型类如果key是字符串,想用索引值访问,值也是字符串(支持多值),用NameValueCollection如果想排序用SortedList或SortedDictionary(支持泛型)根据需要自己选了
      

  5.   

    个人Dictionary用的比较多 给你个例子
    http://www.cnblogs.com/linzheng/archive/2010/12/13/1904709.html