接口方法实现问题

lixianrong890611 2012-03-15 02:10:25
System.TypeLoadException: 程序集“VXTClientDataInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”中的类型“VXTClientDataInterface.ClientDataInterface”的方法“GetNewFiles”没有实现。
在 System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase)
在 System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
在 System.Reflection.Assembly.CreateInstance(String typeName)
在 Common.AssemblyLoader`1.CreateInstance(String strFilePath, String strTypeName) LongRuanDataSynchronizationClient.WinMain.InitClientManager()
...全文
190 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
kaixin2015 2012-03-15
  • 打赏
  • 举报
回复
接口中声明的GetNewFiles, 在你的类中是一致的么? 比如返回值,参数个数, 参数类型等, 还后接口中是否有多个GetNewFiles方法的重载
色拉油 2012-03-15
  • 打赏
  • 举报
回复
实现类里要把接口中的方法都实现
bindofn 2012-03-15
  • 打赏
  • 举报
回复
重新生成一下接口,然后删掉原来的方法,在实现一下接口的方法
bindofn 2012-03-15
  • 打赏
  • 举报
回复
重新生成一下接口,然后删掉原来的方法,在实现一下接口的方法
Rock870210 2012-03-15
  • 打赏
  • 举报
回复
实现接口的类中,方法参数不要改动了,比如参数多了,或者参数数据类型变了,是属于方法重载了。
比如 GetNewFiles(string strArg1)、GetNewFiles(string strArg1, string strArg2)、GetNewFiles(int intArg1)是属于重载
白色的海 2012-03-15
  • 打赏
  • 举报
回复
GetNewFiles的参数和返回值是否和接口的定义一致??!
越活越不精彩 2012-03-15
  • 打赏
  • 举报
回复
方法返回的类型不对
xboxeer 2012-03-15
  • 打赏
  • 举报
回复
方法签名和你接口里面定义的一样么?
wormhole1024 2012-03-15
  • 打赏
  • 举报
回复
继承接口的那个类要实现方法GetNewFiles啊
lixianrong890611 2012-03-15
  • 打赏
  • 举报
回复
可是我接口有这个方法啊!

public IEnumerable<SysFile> GetNewFiles(DateTime dtLast)
{
List<SysFile> files = new List<SysFile>();
var reader = sqlHelper.ExecuteReader("select * from Sys_Upload where EntityName <> null ", System.Data.CommandType.Text);
while (reader.Read())
{
string strPath = string.IsNullOrEmpty((string)reader["Location") ? "" : reader["Location"].ToString().Replace('/', '\\').Replace(@"\\", @"\");

string strID = reader["ID"].ToString();
string strTitle = string.IsNullOrEmpty(reader["FileName"].ToString()) ? "" : reader["FileName"].ToString();
string deptName = reader["DeptName"].ToString();
string className = GetFileClass(reader["Mode"].ToString());
string strFullPath = RootFolderPath + strPath;
string isGD = reader["EntityName"].ToString();
SysFile file = new SysFile()
{
ID = strID,
Title = strTitle,
Department = deptName,
FileClass = className,
Description = "",
FullPath = strFullPath,
FileExt = Path.GetExtension(strFullPath),
FileClassType = FileClassType.Public,
Content = "",
User = reader["Promulgator"].ToString(),
Reserve = isGD,
Size = 0,
CreationTime = DateTime.Now
};

try
{
file.CreationTime = (DateTime)reader["UpLoadTime"];
}
catch { }

if (File.Exists(strFullPath))
file.Size = new FileInfo(strFullPath).Length;

files.Add(file);
}
reader.Close();

return files;

}
]

[Quote=引用 1 楼 wddw1986 的回复:]
方法“GetNewFiles”没有实现。

汉字也不认识吗?
[/Quote]
cheng2005 2012-03-15
  • 打赏
  • 举报
回复
方法“GetNewFiles”没有实现。

汉字也不认识吗?

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧