ActionScript 字典到 C#

发布于 2025-01-03 23:58:16 字数 612 浏览 1 评论 0原文

我正在努力将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虚拟世界 2025-01-10 23:58:16

在 C# 中,您有 Dictionary 类:

var prefixes = new Dictionary<string, string>(); 

然后您可以通过以下方式向其中添加项目:

prefixes["db"] = db;
prefixes["rdf"] = rdf;
prefixes["skos"] = skos;

In C# you have the Dictionary class:

var prefixes = new Dictionary<string, string>(); 

and then you can add items to it this way:

prefixes["db"] = db;
prefixes["rdf"] = rdf;
prefixes["skos"] = skos;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文