Exemple #1
0
        private void exelSave()
        {
            lo.ShowDialog();
            Application app      = new Application();
            Workbook    workbook = app.Workbooks.Add();

            //workbook.SaveAs(Filename: @"C:\Users\USER\Desktop\이것저것\MyShoping.xlsx");
            workbook.SaveAs(Filename: SaveLink + "\\MyShoping.xlsx");

            //workbook = app.Workbooks.Open(Filename: @"C:\Users\USER\Desktop\이것저것\test2.xlsx");
            workbook.SaveAs(Filename: SaveLink + "\\MyShoping.xlsx");

            Worksheet worksheet = workbook.Worksheets.Add();

            int r = 1;

            worksheet.Cells[r, 1] = "상품명";
            worksheet.Cells[r, 2] = "최저가";
            worksheet.Cells[r, 3] = "URL";
            r++;

            foreach (BuyDate d in buylist)
            {
                worksheet.Cells[r, 1] = d.Title;
                worksheet.Cells[r, 2] = d.Lprice;
                worksheet.Cells[r, 3] = d.Link;
                r += 2;
            }
            worksheet.Columns.AutoFit();
            workbook.Save();
            //workbook.SaveAs(Filename: @"C:\Users\USER\Desktop\이것저것\test2.xlsx");
            workbook.Close();
        }
Exemple #2
0
        private void exelSave()
        {
            lo.ShowDialog();
            Application app      = new Application();
            Workbook    workbook = app.Workbooks.Add();

            workbook.SaveAs(Filename: @"C:\Users\USER\Desktop\하기싫어\test2.xlsx");

            workbook = app.Workbooks.Open(Filename: @"C:\Users\USER\Desktop\하기싫어\test2.xlsx");
            Worksheet worksheet = workbook.Worksheets.Add();

            int r = 1;

            foreach (BuyDate d in buylist)
            {
                worksheet.Cells[r, 1] = d.Title;
                worksheet.Cells[r, 2] = d.Lprice;
                worksheet.Cells[r, 3] = d.Link;
                r++;
            }
            workbook.Save();
            //workbook.SaveAs(Filename: @"C:\Users\USER\Desktop\이것저것\test2.xlsx");
            workbook.Close();
        }
Exemple #3
0
        //출력
        private void PlintSearchList()
        {
            panel1.Controls.Clear();
            x = 0;
            y = 0;

            Loading lo = new Loading();

            lo.Function = (() =>
            {
                for (int i = 0; i < bd.buydateList.Count; i++)
                {
                    string filepath = bd.buydateList[i].Image;
                    byte[] data = new System.Net.WebClient().DownloadData(filepath);
                    System.IO.MemoryStream ms = new System.IO.MemoryStream(data);
                    Image img = Image.FromStream(ms);

                    shopingItem item =
                        new shopingItem(img, bd.buydateList[i].Title,
                                        bd.buydateList[i].Lprice_s,
                                        bd.buydateList[i].Link.ToString(),
                                        this);

                    this.Invoke(new MethodInvoker(
                                    delegate()
                    {
                        panel1.Controls.Add(item);
                    }
                                    )
                                );

                    if (x == 0 && y == 0)
                    {
                        this.Invoke(new MethodInvoker(
                                        delegate()
                        {
                            item.Location = new System.Drawing.Point(x, y + 10);
                        }
                                        )
                                    );
                        x = item.Location.X;
                        y = item.Location.Y;
                    }
                    else
                    {
                        this.Invoke(new MethodInvoker(
                                        delegate()
                        {
                            item.Location = new System.Drawing.Point(x, y + 180);
                        }
                                        )
                                    );
                        x = item.Location.X;
                        y = item.Location.Y;
                    }

                    item.num.Text = (i + 1).ToString();
                }
            });
            lo.ShowDialog();
        }