我已經繼承了一些代碼,並且當我嘗試運行代碼時遇到了上述錯誤消息。以下是代碼:C#索引器必須至少有一個參數
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Scripting
{
[CompilerGenerated]
[Guid("C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0")]
[TypeIdentifier]
[ComImport]
public interface IDrive
{
[DispId(0)]
[IndexerName("Path")]
string this[] { [DispId(0)] get; } //The error is here//
[DispId(10009)]
int SerialNumber { [DispId(10009)] get; }
[DispId(10007)]
string VolumeName { [DispId(10007)] get; [DispId(10007)] set; }
[SpecialName]
[MethodImpl(MethodCodeType = MethodCodeType.Runtime)]
void _VtblGap1_7();
[SpecialName]
[MethodImpl(MethodCodeType = MethodCodeType.Runtime)]
void _VtblGap2_1();
}
}
我是C#的新手,想知道缺少哪個參數。
我無法問原始編碼器。任何幫助將不勝感激。
你能指出這個錯誤發生的行號嗎 – sunbabaphu
@sunbabaphu他做到了。 –
對,嗯.... – sunbabaphu