首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请教c#中什么功能相当于php中的lang

2012-10-17 
请问c#中什么功能相当于php中的lang?php$lang[commonName]功能?使用tabletrtd width125px

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


[解决办法]
都一样 的
例子

HTML code
<%@ 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>
[解决办法]
个人Dictionary用的比较多 给你个例子
http://www.cnblogs.com/linzheng/archive/2010/12/13/1904709.html

热点排行