本文介绍了VB所需的帮助 - > C#翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我已经将一些API从VB转换为C#了几天了。 只有我是真正的新手对于这两种语言,但我设法完成了大部分工作 除了下一个语句,所以如果有人知道C#中的对应物是什么,那么这些VB语句的b $ b我会很感激: 公共功能(好吧,公众我知道但C#中的功能是什么?) Public Enum 朋友财产(需要知道朋友和财产) Dim wRecordset作为DAO.Recordset(我需要知道DAO.Recordset部分) 错误GoTo errHandler 私人mCol作为集合(C#对应的集合??,以为我可以 在这里使用对象) 退出功能 设置NewEnum = mCol。[_ NewEnum] 那里有在C#中类似于模块(类)的东西??? Thanx,如果您知道其中任何一个,请回复... 解决方案 - 快乐编码! Morten Wennevik [C#MVP] public class MyClass { } public int myFunction() } (其中int是返回类型,myFunction是函数名称) 几乎相同。 public enum myEnum { element1, element2 } internal int myProperty {获得 {返回someValue; } 设置 { someVariable = value; } 没有这样的事情。 DataTable可能是最接近的东西,你必须 读取它我很害怕,因为它们完全不同。 可以 Hashtable mCol =新的Hashtable(); 不要忘记在顶部放置一个''using System.Collections''。 IEnumerator newEnum = mCol.GetEnumerator() 公共类MyClass { } Hi,I''ve been translating some API''s from VB to C# for a couple of days now.Only I''m a real newbie to both languages, but I managed to do most of itexcept the next statements, so if anyone knows what the counterpart in C# isof those VB statements I would appreciate :Public Function (ok, public I know but what is a Function in C# ?)Public EnumFriend Property (need to know both Friend and Property)Dim wRecordset As DAO.Recordset (I need to know the DAO.Recordset part)On Error GoTo errHandlerPrivate mCol as Collection (C# counterpart of Collection ??, thought i coulduse object here)Exit FunctionSet NewEnum = mCol.[_NewEnum]And is there in C# something like modules (classes) ???Thanx, please respond if u knw any of these... 解决方案--Happy coding!Morten Wennevik [C# MVP]public class MyClass{} public int myFunction() { } (where int is the return type, myFunction is the function name) pretty much the same. public enum myEnum { element1, element2 } internal int myProperty { get { return someValue; } set { someVariable = value; } } No such thing. DataTable is probably the closest thing, you''ll have toread up on it I''m afraid as they''re quite different. could Hashtable mCol = new Hashtable(); Don''t forget to put a ''using System.Collections'' at the top. return IEnumerator newEnum = mCol.GetEnumerator() public class MyClass { } 这篇关于VB所需的帮助 - > C#翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-27 23:45
查看更多