public class tagTLSEEKINFO
{
/* Disable variable visibility on debug. */
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private DateTime date;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string month;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string year;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int trunk;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int addr;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int subzone;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private tagTLFILETYPE filetype;
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string path;
public tagTLSEEKINFO()
{
Path = "";
}
public tagTLSEEKINFO(tagTLFILETYPE filetype)
{
FileType = filetype;
}
public tagTLSEEKINFO(tagTLFILETYPE filetype, string _path)
{
Month = "";
Year = "";
Trunk = Addr = Subzone = 0;
FileType = filetype;
Path = _path;
}
public tagTLSEEKINFO(DateTime date, tagTLFILETYPE filetype)
{
Date = date;
Month = date.Month.ToString("00");
Year = date.Year.ToString().Remove(0, 2);
Trunk = Addr = Subzone = 0;
FileType = filetype;
}
public tagTLSEEKINFO(string month, string year, tagTLFILETYPE filetype)
{
Date = new DateTime(Convert.ToInt16(year), Convert.ToInt16(month), 1);
Month = month;
Year = year;
Trunk = Addr = Subzone = 0;
FileType = filetype;
}
public tagTLSEEKINFO(DateTime date, int trunk, int addr, int subzone)
{
Date = date;
Month = date.Month.ToString("00");
Year = date.Year.ToString().Remove(0, 2);
Trunk = trunk;
Addr = addr;
Subzone = subzone;
FileType = tagTLFILETYPE.TRENDLOG;
}
public tagTLSEEKINFO(string month, string year, int trunk, int addr, int subzone)
{
Month = month;
Year = year;
Trunk = trunk;
Addr = addr;
Subzone = subzone;
FileType = tagTLFILETYPE.TRENDLOG;
}
public virtual DateTime Date { get { return date; } set { date = value; } }
public virtual string Month { get { return month; } set { month = value; } }
public string Year { get { return year; } set { year = value; } }
public int Trunk { get { return trunk; } set { trunk = value; } }
public int Addr { get { return addr; } set { addr = value; } }
public int Subzone { get { return subzone; } set { subzone = value; } }
public tagTLFILETYPE FileType { get { return filetype; } set { filetype = value; } }
public string Path { get { return path; } set { path = value; } }
}//end class
내가 필요로하는 특성 (날짜)를 사용하려고, 난이 얻을를 오류 :
Error CS1061 'tagTLSEEKINFO[]' does not contain a definition for 'Date' and no extension method 'Date' accepting a first argument of type 'tagTLSEEKINFO[]' could be found (are you missing a using directive or an assembly reference?) TrendLogFileViewer
오류가 발생하는 라인을 표시 할 수 있습니까? – Allen
문제가 확실하게 재현되는 좋은 [mcve]가 없다면 확실히 말할 수는 없습니다. 그러나 오류 메시지를 기반으로, 당신은'tagTLSEEKINFO' 객체의 배열을 가지고 있으며 배열을 색인화하고 배열의 단일 요소에서 속성 값을 검색하는 대신 배열에서'Date' 속성 값을 검색하려고합니다 . 너는 그렇게 할 수 없다. 값을 가져 오려는 요소를 알아 내고 해당 요소를 가져 오는 데 적절한 색인 값을 사용하십시오. –