diff --git a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo index a27578a..9397d4d 100644 Binary files a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo and b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo differ diff --git a/ISBN_Check_test/Form1.Designer.cs b/ISBN_Check_test/Form1.Designer.cs index f8d006d..d266ce6 100644 --- a/ISBN_Check_test/Form1.Designer.cs +++ b/ISBN_Check_test/Form1.Designer.cs @@ -29,17 +29,11 @@ namespace ISBN_Check_test /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.button1 = new System.Windows.Forms.Button(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.label1 = new System.Windows.Forms.Label(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.start_idx = new System.Windows.Forms.TextBox(); - this.end_idx = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.button2 = new System.Windows.Forms.Button(); this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.author = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.book_comp = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -50,6 +44,12 @@ namespace ISBN_Check_test this.category = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label1 = new System.Windows.Forms.Label(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.start_idx = new System.Windows.Forms.TextBox(); + this.end_idx = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // @@ -74,14 +74,14 @@ namespace ISBN_Check_test // // dataGridView1 // - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle5.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.book_name, this.author, @@ -96,14 +96,14 @@ namespace ISBN_Check_test this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnF2; this.dataGridView1.Location = new System.Drawing.Point(12, 38); this.dataGridView1.Name = "dataGridView1"; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; this.dataGridView1.Size = new System.Drawing.Size(892, 466); @@ -113,59 +113,6 @@ namespace ISBN_Check_test this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint); this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(659, 13); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(38, 12); - this.label1.TabIndex = 4; - this.label1.Text = "label1"; - // - // richTextBox1 - // - this.richTextBox1.Location = new System.Drawing.Point(12, 510); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(892, 96); - this.richTextBox1.TabIndex = 5; - this.richTextBox1.Text = ""; - // - // start_idx - // - this.start_idx.Location = new System.Drawing.Point(166, 9); - this.start_idx.Name = "start_idx"; - this.start_idx.Size = new System.Drawing.Size(42, 21); - this.start_idx.TabIndex = 6; - this.start_idx.Text = "1"; - this.start_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); - // - // end_idx - // - this.end_idx.Location = new System.Drawing.Point(234, 9); - this.end_idx.Name = "end_idx"; - this.end_idx.Size = new System.Drawing.Size(42, 21); - this.end_idx.TabIndex = 6; - this.end_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(214, 13); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(14, 12); - this.label2.TabIndex = 4; - this.label2.Text = "~"; - // - // button2 - // - this.button2.Location = new System.Drawing.Point(409, 8); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 2; - this.button2.Text = "리 셋"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // // book_name // this.book_name.HeaderText = "도서명"; @@ -223,6 +170,59 @@ namespace ISBN_Check_test this.Column1.Name = "Column1"; this.Column1.Visible = false; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(659, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(65, 12); + this.label1.TabIndex = 4; + this.label1.Text = "00:00:00.00"; + // + // richTextBox1 + // + this.richTextBox1.Location = new System.Drawing.Point(12, 510); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(892, 96); + this.richTextBox1.TabIndex = 5; + this.richTextBox1.Text = ""; + // + // start_idx + // + this.start_idx.Location = new System.Drawing.Point(166, 9); + this.start_idx.Name = "start_idx"; + this.start_idx.Size = new System.Drawing.Size(42, 21); + this.start_idx.TabIndex = 6; + this.start_idx.Text = "1"; + this.start_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); + // + // end_idx + // + this.end_idx.Location = new System.Drawing.Point(234, 9); + this.end_idx.Name = "end_idx"; + this.end_idx.Size = new System.Drawing.Size(42, 21); + this.end_idx.TabIndex = 6; + this.end_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(214, 13); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(14, 12); + this.label2.TabIndex = 4; + this.label2.Text = "~"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(409, 8); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 2; + this.button2.Text = "리 셋"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); diff --git a/ISBN_Check_test/Form1.cs b/ISBN_Check_test/Form1.cs index 1712121..5c4e1cc 100644 --- a/ISBN_Check_test/Form1.cs +++ b/ISBN_Check_test/Form1.cs @@ -54,7 +54,7 @@ namespace ISBN_Check_test // 발행일 / 도서분류 / 재고 string[] param = { "title", "author", "publisher", "isbn13", "priceStandard", "pubDate", "categoryName", "stockStatus" }; - Aladin_API api = new Aladin_API(); + API api = new API(); switch (comboBox1.SelectedIndex) { case 0: // 제목+저자 @@ -79,7 +79,7 @@ namespace ISBN_Check_test } query = Set_query(type, a); - insert_API(api.Find(query, type, param), a); + insert_API(api.Aladin(query, type, param), a); } stopwatch.Stop(); diff --git a/ISBN_Check_test/Form1_Sub.cs b/ISBN_Check_test/Form1_Sub.cs index c45036b..1a07314 100644 --- a/ISBN_Check_test/Form1_Sub.cs +++ b/ISBN_Check_test/Form1_Sub.cs @@ -13,7 +13,7 @@ using System.Xml; namespace ISBN_Check_test { - class Aladin_API + class API { /// /// https://blog.aladin.co.kr/openapi 참고 @@ -22,14 +22,14 @@ namespace ISBN_Check_test /// /// /// - public string Find(string Query, string QueryType, string[] Param) + public string Aladin(string Query, string QueryType, string[] Param) { string result = string.Empty; // 쿼리 생성 string key = "ttbgloriabook1512001"; string site = "http://www.aladin.co.kr/ttb/api/ItemSearch.aspx"; string query = string.Format("{0}?query={1}&TTBKey={2}&output=xml&querytype={3}&MaxResults={4}", - site, Query, key, "Title", 30.ToString()); + site, Query, key, QueryType, 30.ToString()); // 쿼리를 입력인자로 WebRequest 개채 생성 WebRequest request = WebRequest.Create(query); @@ -100,6 +100,91 @@ namespace ISBN_Check_test } return result; } + public string Naver(string[] Query, string[] Param) + { + string result = string.Empty; + string json = string.Empty; + // url 생성 + string url = "https://openapi.naver.com/v1/search/book_adv?"; + + if(Query[0] != null || Query[0] != "") + url += "d_titl=" + Query[0] + "&"; + + if(Query[1] != null || Query[1] != "") + url += "d_auth=" + Query[1] + "&"; + + if(Query[2] != null || Query[2] != "") + url += "d_publ=" + Query[2] + "&"; + + // + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + + request.Headers.Add("X-Naver-Client-Id", "wYr0JczCBoDopq1NKTyQ"); // 클라이언트 아이디 + request.Headers.Add("X-Naver-Client-Secret", "QHzeXadtO7"); // 클라이언트 시크릿 + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + string status = response.StatusCode.ToString(); + if (status == "OK") + { + Stream stream = response.GetResponseStream(); + StreamReader reader = new StreamReader(stream, Encoding.UTF8); + json = reader.ReadToEnd(); + } + else + { + MessageBox.Show(status, "Error"); + return "Error"; + } + /* + // xml형식을 json형식으로 변환 + XmlDocument doc = new XmlDocument(); + //doc.LoadXml(xml); + doc.Load(xml); + var json = JsonConvert.SerializeXmlNode(doc); + */ + // json형식 분석을 위해 JavaScriptSerializer 개체 생성 + JavaScriptSerializer js = new JavaScriptSerializer(); + + // 런타임에 개체를 확인하여 사용할수 있는 dynamic을 이용해 역직렬화 + dynamic dob = js.Deserialize(json); + + // "object"내에 있는것을 얻어오기 위해 다시 dynamic변수에 참조 + dynamic docs = ""; + try + { + // docs = dob["object"]["item"]; + docs = dob["items"]; + } + catch + { + return ""; + } + int length = 0; + int ID_length = Param.Length; + + // 검색 결과가 1개 이하일 경우, 오류가 발생하여 try/catch문 사용. + try + { + // docs는 요소 컬렉션으로 object로 변환. + object[] buf = docs; + length = buf.Length; + } + catch + { + object buf = docs; + length = 1; + } + for (int a = 0; a < length; a++) + { + List tmp_data = new List(); + for (int b = 0; b < ID_length; b++) + { + tmp_data.Add(docs[a][Param[b]]); + result += tmp_data[b] + "|"; + } + result += "\n\t"; + } + return result; + } } class Skill_Grid { diff --git a/ISBN_Check_test/Form3.Designer.cs b/ISBN_Check_test/Form3.Designer.cs new file mode 100644 index 0000000..2ac01e3 --- /dev/null +++ b/ISBN_Check_test/Form3.Designer.cs @@ -0,0 +1,216 @@ + +namespace ISBN_Check_test +{ + partial class Form3 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.tb_book_name = new System.Windows.Forms.TextBox(); + this.tb_author = new System.Windows.Forms.TextBox(); + this.tb_book_comp = new System.Windows.Forms.TextBox(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(221, 38); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 4; + this.button1.Text = "검 색"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // tb_book_name + // + this.tb_book_name.Location = new System.Drawing.Point(71, 12); + this.tb_book_name.Name = "tb_book_name"; + this.tb_book_name.Size = new System.Drawing.Size(225, 21); + this.tb_book_name.TabIndex = 0; + this.tb_book_name.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_book_name_KeyDown); + // + // tb_author + // + this.tb_author.Location = new System.Drawing.Point(71, 39); + this.tb_author.Name = "tb_author"; + this.tb_author.Size = new System.Drawing.Size(139, 21); + this.tb_author.TabIndex = 1; + this.tb_author.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_book_name_KeyDown); + // + // tb_book_comp + // + this.tb_book_comp.Location = new System.Drawing.Point(71, 66); + this.tb_book_comp.Name = "tb_book_comp"; + this.tb_book_comp.Size = new System.Drawing.Size(225, 21); + this.tb_book_comp.TabIndex = 2; + this.tb_book_comp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_book_name_KeyDown); + // + // richTextBox1 + // + this.richTextBox1.Location = new System.Drawing.Point(12, 93); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(300, 161); + this.richTextBox1.TabIndex = 3; + this.richTextBox1.Text = ""; + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Column1, + this.Column2, + this.Column3, + this.Column4, + this.Column5, + this.Column6, + this.Column7}); + this.dataGridView1.Location = new System.Drawing.Point(318, 12); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.RowTemplate.Height = 23; + this.dataGridView1.Size = new System.Drawing.Size(763, 242); + this.dataGridView1.TabIndex = 5; + // + // Column1 + // + this.Column1.HeaderText = "title"; + this.Column1.Name = "Column1"; + // + // Column2 + // + this.Column2.HeaderText = "author"; + this.Column2.Name = "Column2"; + // + // Column3 + // + this.Column3.HeaderText = "publisher"; + this.Column3.Name = "Column3"; + // + // Column4 + // + this.Column4.HeaderText = "isbn"; + this.Column4.Name = "Column4"; + // + // Column5 + // + this.Column5.HeaderText = "price"; + this.Column5.Name = "Column5"; + // + // Column6 + // + this.Column6.HeaderText = "pubdate"; + this.Column6.Name = "Column6"; + // + // Column7 + // + this.Column7.HeaderText = "discount"; + this.Column7.Name = "Column7"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.label1.Location = new System.Drawing.Point(20, 16); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(46, 13); + this.label1.TabIndex = 6; + this.label1.Text = "도서명"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.label2.Location = new System.Drawing.Point(26, 43); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(33, 13); + this.label2.TabIndex = 6; + this.label2.Text = "저자"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.label3.Location = new System.Drawing.Point(20, 70); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(46, 13); + this.label3.TabIndex = 6; + this.label3.Text = "출판사"; + // + // Form3 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1093, 266); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.tb_book_comp); + this.Controls.Add(this.tb_author); + this.Controls.Add(this.tb_book_name); + this.Controls.Add(this.button1); + this.Name = "Form3"; + this.Text = "Form3"; + this.Load += new System.EventHandler(this.Form3_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox tb_book_name; + private System.Windows.Forms.TextBox tb_author; + private System.Windows.Forms.TextBox tb_book_comp; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn Column1; + private System.Windows.Forms.DataGridViewTextBoxColumn Column2; + private System.Windows.Forms.DataGridViewTextBoxColumn Column3; + private System.Windows.Forms.DataGridViewTextBoxColumn Column4; + private System.Windows.Forms.DataGridViewTextBoxColumn Column5; + private System.Windows.Forms.DataGridViewTextBoxColumn Column6; + private System.Windows.Forms.DataGridViewTextBoxColumn Column7; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + } +} \ No newline at end of file diff --git a/ISBN_Check_test/Form3.cs b/ISBN_Check_test/Form3.cs new file mode 100644 index 0000000..8e65950 --- /dev/null +++ b/ISBN_Check_test/Form3.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ISBN_Check_test +{ + public partial class Form3 : Form + { + public Form3() + { + InitializeComponent(); + } + private void Form3_Load(object sender, EventArgs e) + { + + } + private void button1_Click(object sender, EventArgs e) + { + dataGridView1.Rows.Clear(); + + API api = new API(); + // 도서명, 저자, 출판사 + string[] ArrayValue = { tb_book_name.Text, tb_author.Text, tb_book_comp.Text }; + + // 도서명 / 저자 / 출판사 / isbn / 정가 + // 발행일 / 도서분류 / 재고 + string[] param = { "title", "author", "publisher", "isbn", "price", + "pubdate", "discount" }; + string result = api.Naver(ArrayValue, param); + richTextBox1.Text = result; + + input_Grid(result); + } + private void input_Grid(string value) + { + value = value.Replace("", ""); + value = value.Replace("", ""); + + string[] sp_data = value.Split('\t'); + string[] grid = { "", "", "", "", "", "", "" }; + + for(int a = 0; a < sp_data.Length; a++) + { + string[] data = sp_data[a].Split('|'); + if (data.Length > 7) { + data[1] += ", " + data[2]; + data[2] = data[3]; + if(data[4].Contains(" ") == true) { + string[] isbn = data[4].Split(' '); + data[3] = isbn[1]; + } + else + data[3] = data[4]; + + data[4] = data[5]; + data[5] = data[6]; + + if(data[7] == "") + data[6] = "절판"; + else + data[6] = data[7]; + } + dataGridView1.Rows.Add(data); + } + + /* + string[] sp_data = value.Split('|'); + string[] grid = { "", "", "", "", "", "", "" }; + + for(int a= 0; a < sp_data.Length - 1; a++) + { + if (a % 7 == 0) { grid[0] = sp_data[a]; } // 도서명 + if (a % 7 == 1) { grid[1] = sp_data[a]; } // 저자 + if (a % 7 == 2) { grid[2] = sp_data[a]; } // 출판사 + if (a % 7 == 3) { + if (sp_data[a].Contains(" ") == true) { + string[] tmp_isbn = sp_data[a].Split(' '); + sp_data[a] = tmp_isbn[1]; + } + grid[3] = sp_data[a]; + } // isbn + if (a % 7 == 4) { grid[4] = sp_data[a]; } // 정가 + if (a % 7 == 5) { grid[5] = sp_data[a]; } // 출간일 + if (a % 7 == 6) { + if (sp_data[a] == "") { sp_data[a] = "절판"; } + grid[6] = sp_data[a]; // 재고? + dataGridView1.Rows.Add(grid); + } + } + */ + } + private void tb_book_name_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) { + button1_Click(null, null); + } + } + } +} diff --git a/ISBN_Check_test/Form3.resx b/ISBN_Check_test/Form3.resx new file mode 100644 index 0000000..e6ca147 --- /dev/null +++ b/ISBN_Check_test/Form3.resx @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ISBN_Check_test/ISBN_Check_test.csproj b/ISBN_Check_test/ISBN_Check_test.csproj index 8fa00bd..62bf443 100644 --- a/ISBN_Check_test/ISBN_Check_test.csproj +++ b/ISBN_Check_test/ISBN_Check_test.csproj @@ -94,6 +94,12 @@ Form1.cs + + Form + + + Form3.cs + @@ -102,6 +108,9 @@ Form2.cs + + Form3.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/ISBN_Check_test/ISBN_Check_test.csproj.user b/ISBN_Check_test/ISBN_Check_test.csproj.user index bc37907..2300ee8 100644 --- a/ISBN_Check_test/ISBN_Check_test.csproj.user +++ b/ISBN_Check_test/ISBN_Check_test.csproj.user @@ -10,4 +10,7 @@ ko-KR false + + false + \ No newline at end of file diff --git a/ISBN_Check_test/Program.cs b/ISBN_Check_test/Program.cs index 2f7dbe3..72612a2 100644 --- a/ISBN_Check_test/Program.cs +++ b/ISBN_Check_test/Program.cs @@ -16,7 +16,7 @@ namespace ISBN_Check_test { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new Form3()); } } } diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.application b/ISBN_Check_test/bin/Debug/ISBN_Check_test.application index ecee7b9..d132234 100644 --- a/ISBN_Check_test/bin/Debug/ISBN_Check_test.application +++ b/ISBN_Check_test/bin/Debug/ISBN_Check_test.application @@ -21,7 +21,7 @@ - Am2ytJb0WwA75Qq7rW//xmBu/XXV++8p9i9pQOkNpHM= + EpqnJmtwhiOZuKRdDrM0DSvLzQz12spMGKuJACJu2Yg= diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe index e404f35..4eed889 100644 Binary files a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe and b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest index dfb8241..f532d63 100644 --- a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest +++ b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest @@ -42,14 +42,14 @@ - + - 9D50zjf7GDXlg2foJ4v0vcTR0ESoN/go6tY4H9KBpog= + fsSd+LiztaAxTOAmbgfeVhaFlrxQ1cy58pUjhOM7KYk= @@ -74,13 +74,13 @@ R+Wg8QGvQVHX8T0ta/qbhH1bXkqY0fRnS3wBV3J0bN8= - + - CRPL1jblU+8pXmE7HEtUXmhuXtbddRTfJLULZzX2WIg= + lTOd/OLXwh6JpIcu+C0Na9lEQu7w0grVKSl8AuVOJo4= \ No newline at end of file diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb b/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb index d3d5485..9e5addf 100644 Binary files a/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb and b/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb differ diff --git a/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe b/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe index 29b74d0..a37e2b4 100644 Binary files a/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe and b/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.Form3.resources b/ISBN_Check_test/obj/Debug/ISBN_Check_test.Form3.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.Form3.resources differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.application b/ISBN_Check_test/obj/Debug/ISBN_Check_test.application index ecee7b9..d132234 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.application +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.application @@ -21,7 +21,7 @@ - Am2ytJb0WwA75Qq7rW//xmBu/XXV++8p9i9pQOkNpHM= + EpqnJmtwhiOZuKRdDrM0DSvLzQz12spMGKuJACJu2Yg= diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.CoreCompileInputs.cache b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.CoreCompileInputs.cache index 4d0c00b..0ddd9ec 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.CoreCompileInputs.cache +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -770549080d8db675a090abc4a7233681ae4255d4 +7168c84a37b1e463481ad93f91c8f272b9c88364 diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.FileListAbsolute.txt b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.FileListAbsolute.txt index f1b0e50..fe4c3e8 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.FileListAbsolute.txt +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.FileListAbsolute.txt @@ -29,3 +29,5 @@ C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\bin\Debug\ISBN_Check_test C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\bin\Debug\ISBN_Check_test.application C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\obj\Debug\ISBN_Check_test.exe.manifest C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\obj\Debug\ISBN_Check_test.application +C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\obj\Debug\ISBN_Check_test.csprojAssemblyReference.cache +C:\Users\Administrator\Desktop\unimarc\ISBN_Check_test\obj\Debug\ISBN_Check_test.Form3.resources diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache index 0af31c4..f672f53 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache new file mode 100644 index 0000000..9011fd2 Binary files /dev/null and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe index e404f35..4eed889 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest index dfb8241..f532d63 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest @@ -42,14 +42,14 @@ - + - 9D50zjf7GDXlg2foJ4v0vcTR0ESoN/go6tY4H9KBpog= + fsSd+LiztaAxTOAmbgfeVhaFlrxQ1cy58pUjhOM7KYk= @@ -74,13 +74,13 @@ R+Wg8QGvQVHX8T0ta/qbhH1bXkqY0fRnS3wBV3J0bN8= - + - CRPL1jblU+8pXmE7HEtUXmhuXtbddRTfJLULZzX2WIg= + lTOd/OLXwh6JpIcu+C0Na9lEQu7w0grVKSl8AuVOJo4= \ No newline at end of file diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb b/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb index d3d5485..9e5addf 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb differ