ActionScript 字典到 C#
我正在努力将 Action Sript 类转换为 C#,现在我正在选择适当的数据类型来替换 ActionScript
数据类型...我想知道什么是最好的 C# 数据类型< /code> 替换 Actionscript 中的
字典数据类型
这是一个示例代码
public static const db:String = "http://dbpedia.org/resource/";
public static const rdf:String = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
public static const skos:String = "http://www.w3.org/2004/02/skos/core#";
private var prefixes:Dictionary = new Dictionary();
public function SPARQLQueryBuilder() {
prefixes["db"] = db;
prefixes["rdf"] = rdf;
prefixes["skos"] = skos;
}
i'm working on converting an Action Sript class to C# and now i'm choosing a proper data types to replace ActionScript
data Types ... and i wondered what is the best C# datatype
to replace the Dictionary Datatype
in Actionscript
here's a sample code for example
public static const db:String = "http://dbpedia.org/resource/";
public static const rdf:String = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
public static const skos:String = "http://www.w3.org/2004/02/skos/core#";
private var prefixes:Dictionary = new Dictionary();
public function SPARQLQueryBuilder() {
prefixes["db"] = db;
prefixes["rdf"] = rdf;
prefixes["skos"] = skos;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 C# 中,您有 Dictionary 类:
然后您可以通过以下方式向其中添加项目:
In C# you have the Dictionary class:
and then you can add items to it this way: