我有一個VB6編譯的DLL,我已經導入到web服務(C#ASMX)。
在VB6我有這個以下幾種類型:
Public Type typeAccountInfo
singular As String
code As String
description As String
End Type
Public Type timeSheetRowPost
lock As Boolean
code As String
from As Long
to As Long
fakt As Boolean
ik As String
ek As String
ak As String
accounts() As typeAccountInfo
End Type
Public Type timeSheetDayPosts
date As String
scheduleFrom As Long
scheduleTo As Long
break As Long
dagPost() As timeSheetRowPost
End Type
Public Type timeSheet
period As String
dayCount As Long
days() As timeSheetDayPosts
End Type
的TimeSheet> timeSheetDayPosts> timeSheetRowPosts> typeAccountInfo
我有一個VB6功能得到我需要的所有數據。
,當我在我的web ASMX實現這一點,我這樣做以下列方式:
public List<returnType> myFunction(input parameters){
List<timeSheet> VB6Array = new List<timeSheet>();
VB6Array = new List<timeSheet>((timeSheet[])VBWrapper.myVB6Func(input params));
// at this point VB6Array holds all the data i need. And all i need (want) at this point is to be able to cast this VB6(system.array) to a List<> object that i can return as my returntype.
// Pseudo : List<ReturnType> myNewReturnType = new List<ReturnType>((ReturnType[])VB6Array);
// However all my tries has been without success....and what i get is You must implement a default accessor on System.Array because it inherits from ICollection.
return myNewReturnType;
}
就怎麼投或轉換VB6的類型(System.Array的)的任何提示和/或指針名單<>將不勝感激。
在此先感謝。
我有我的希望,但它給了我: 無法通過類型「system.collections.generic.list」轉換爲「列表」一個內置的轉換 –
doge
2012-02-29 14:47:10
對不起近卻無雪茄Da_smokes。 btw對你的健康有害。 – Har 2012-03-01 14:53:25
手動循環瀏覽列表並添加它們我的自己的類型工作正常,這只是一個問題。 – doge 2012-03-05 06:57:06