在foreach中超载的值,如何解决? [英] overload values in a foreach, how to fix?

查看:99
本文介绍了在foreach中超载的值,如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个已被复制的值。
Int的logid和int DLLid。



我有这个,但它说:没有重载方法copyfiles需要1个参数



我该如何解决这个问题?

$ foreach(UpdateList.Items中的ListItem项目)
{
if(item.Selected == true)
{
CopyFiles(item.Value);


方法拷贝文件:

  private void CopyFiles(int logId,int dllId)
{
iLogging log = controller.Logging_Get(logId);
iDLLFile dll = controller.DLLFile_Get(dllId);
if(log == null)return;
if(dll == null)return;


解决方案 CopyFiles 需要两个参数( int logID int dllID )错误,因为你只提供了一个单一的参数。

你需要提供这两个,但我们不能说这是什么第二个参数应该是从你的信息已经提供了。


I have 2 values that has been copied. the Int logid and int DLLid.

I have this but its says: No overload for method "copyfiles" takes 1 arguments.

how can I fix this?

foreach (ListItem item in Updatelist.Items)
{
    if (item.Selected == true)
    {
        CopyFiles(item.Value);
    }
}

the method copy files:

private void CopyFiles(int logId, int dllId)
{
    iLogging log = controller.Logging_Get(logId);
    iDLLFile dll = controller.DLLFile_Get(dllId);
    if (log == null) return;
    if (dll ==  null) return;
}

解决方案

The method CopyFiles requires two parameters (int logID and int dllID) you are receiving this error because you are only providing it with a single parameter.

You need to provide it with both, but we cannot say what this second parameter should be from the information that you have provided.

这篇关于在foreach中超载的值,如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆