有一个哈稀表数组,怎么把他添加到Text中去!!!

[复制链接]
查看11 | 回复2 | 2009-1-6 10:14:37 | 显示全部楼层 |阅读模式
///
/// 定义一个数组来装用户信息
///
public Hashtable accountMessage = new Hashtable();
public void wenjian()

{

string []sa;

for (int i = 0; i < accountMessage.Count; i++)

{

File.WriteAllLines(@"G:\c#的作业\书店管理系统\书店管理系统,accountMessage",******);



}

}
简单说怎么打****那里怎么添!!!!!!!!
(明天的作业啊!!!!!!!)
那个string []sa; 不要啊!!!
多余的!!!

回复

使用道具 举报

千问 | 2009-1-6 10:14:37 | 显示全部楼层
string str = "";for (int i = 0; i < accountMessage.Count; i++){str += accountMessage["key"] + "\r\n";}File.WriteAllLines("路径", str);...
回复

使用道具 举报

千问 | 2009-1-6 10:14:37 | 显示全部楼层
用foreach ( DictionaryEntry de in accountMessage ){...}遍历所有的值。de的两个属性(键/值), de.Key, de.Value。具体代码就不多说了。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行