Esempio n. 1
0
        private void ExcelScanIntenal(Workbook workBookIn)
        {
            int       numSheets  = workBookIn.Sheets.Count;
            Worksheet sheet      = (Worksheet)workBookIn.Sheets[1];
            Range     excelRange = sheet.UsedRange;

            int rowCount = excelRange.Rows.Count;
            int colCount = excelRange.Columns.Count;

            for (int i = 2; i <= rowCount; i++)
            {
                string type      = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 1]).Value2.ToString();
                string loginname = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 2]).Value2.ToString();
                string member    = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 3]).Value2.ToString();
                string password  = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 4]).Value2.ToString();
                string credit    = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 5]).Value2.ToString();
                string group     = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 6]).Value2.ToString();
                string status    = "";
                try
                {
                    status = ((Microsoft.Office.Interop.Excel.Range)excelRange.Cells[i, 7]).Value2.ToString();
                }
                catch (Exception)
                {
                    status = "";
                }

                if (status.Trim() == "")
                {
                    objRow r = new objRow();
                    r.type      = type;
                    r.loginname = loginname;
                    r.member    = member;
                    r.password  = password;
                    r.credit    = credit;
                    r.group     = group;

                    sheet.Cells[i, 7] = createSbobetMember(r);
                    workBookIn.Save();
                }
            }
            helper.Close();
        }