[求助]这样子对吗?郁闷!达人进来
今天在书上看了一例子,想用到毕设中,可是是用VB 写的,看不懂。Public Function GetMessages() As String()
Dim MessageArray(20) As String
Dim I As Interger
Application.Lock()
For I=0 To MessageArray.Length -1
MessageArray(I) =Application("Message"& I)
Next
Application.UnLock()
GetMessage=MessageArray
End Function
我想把它写成C#,按我的理解,改完是这样的,可是编译好像不行,达人帮帮忙
public string[] GetMessages()
{
String[] MessageArray=new string[20];
int i;
Application.Lock();
for(i=0;i<MessageArray.Length-1;i++)
MessageArray[i]=Application[Message+i];
Application.UnLock();
GetMessages=MessageArray;
}