升C code错误错误、code

由网友(凉透心怎能重来)分享简介:可能重复: 使用开关case语句 Possible Duplicate:Issue using switch case statement 我有code这样目前using System;using System.Collections.Generic;using System.Linq;using Syst...

可能重复:   使用开关case语句

Possible Duplicate: Issue using switch case statement

我有code这样目前

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Drawing;
using System.ComponentModel;
using Excel = Microsoft.Office.Interop.Excel;
using Microsoft.Office.Interop.Excel;
namespace Excel1
{
    class Program
    {
        static void Main(string[] args)
        //public void ExcelOps()
        {
            //string str;
            Excel.Application xlApp = new Excel.Application();
            Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(@"D:/WebServiceTemplate.xlsx");
            Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
            Excel.Range xlRange = xlWorksheet.UsedRange;
            int rowCount = xlRange.Rows.Count;
            int colCount = xlRange.Columns.Count;
            int numSheets = xlWorkbook.Sheets.Count;
            //
            // Iterate through the sheets. They are indexed starting at 1.
            //
            for (int sheetNum = 1; sheetNum <=1; sheetNum++)
            {
                Worksheet sheet = (Worksheet)xlWorkbook.Sheets[sheetNum];
                //
                // Take the used range of the sheet. Finally, get an object array of all
                // of the cells in the sheet (their values). 
                //
                object[,] valueArray = (object[,])xlRange.get_Value(XlRangeValueDataType.xlRangeValueDefault);
                //
                // Do something with the data in the array with a custom method.
                //                
                ProcessInput(valueArray);
            }
        }
        public static void ProcessInput()
        {
        }
    }
}

我试图做一些事情的数据与自定义的方法到数组中。当我运行它,我得到一个错误错误没有重载方法的ProcessInput'需要1参数

I am trying to do something with the data in the array with a custom method. When I run it, I get an error "Error No overload for method 'ProcessInput' takes 1 arguments"

什么是错的?我该如何继续前进,纠正这种?

What is wrong? How do I go ahead and rectify this?

推荐答案

如果这是完整 code时,编译器是绝对正确的。

if this is a complete code, the compiler is absolutely right.

您不必任何 的ProcessInput(..); 在此code函数定义

You don't have any ProcessInput(..); function definition in this code.

修改

看好的修改的职位会说,你错过了什么是宣布你的的ProcessInput 的功能就像一个静态

Looking on edited post would say that what you missed is declaring your ProcessInput functions like a static

    public static void ProcessInput()
    {
       ....
    }
阅读全文

相关推荐

最新文章