{"id":1251,"date":"2024-01-18T18:02:54","date_gmt":"2024-01-18T09:02:54","guid":{"rendered":"https:\/\/prg.waou.biz\/?p=1251"},"modified":"2024-01-18T18:02:54","modified_gmt":"2024-01-18T09:02:54","slug":"%e7%94%bb%e5%83%8f%e3%82%92%e6%89%b1%e3%81%86","status":"publish","type":"post","link":"https:\/\/prg.waou.biz\/?p=1251","title":{"rendered":"\u753b\u50cf\u3092\u6271\u3046"},"content":{"rendered":"<p>       private void button8_Click(object sender, EventArgs e)<br \/>\n        {<br \/>\n            \/\/\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3059\u308b<br \/>\n            string file = Application.StartupPath + &#8220;\\\\1.jpg&#8221;;<br \/>\n            byte[] imgBody = File.ReadAllBytes(file);<br \/>\n            int x = gcMultiRowKamoku.CurrentRow.Index;<\/p>\n<p>            string date = gcMultiRowKamoku.GetValue(x, &#8220;textINPDATA&#8221;).ToString();<\/p>\n<p>            using (var con = new FbConnection(gro.conString))<br \/>\n            {<br \/>\n                try<br \/>\n                {<br \/>\n                    using (FbCommand cmd = con.CreateCommand())<br \/>\n                    {<br \/>\n                        con.Open();<br \/>\n                        cmd.CommandText = &#8220;update chatGPT set imgBody = @imgBody   where inpData =   &#8216;&#8221; + date + &#8220;&#8216;&#8221;;<\/p>\n<p>                        cmd.Parameters.Add(new FbParameter(&#8220;@imgBody&#8221;, imgBody));<br \/>\n                        cmd.ExecuteNonQuery();<\/p>\n<p>                    }<\/p>\n<p>                }<br \/>\n                catch (Exception ex)<br \/>\n                {<br \/>\n                    noby.Message(ex.ToString(), m.Stop);<br \/>\n                }<br \/>\n                finally<br \/>\n                {<br \/>\n                    con.Close();<br \/>\n                }<\/p>\n<p>            }<\/p>\n<p>        }<\/p>\n<p>        private void button5_Click_1(object sender, EventArgs e)<br \/>\n        {\/\/\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3080\u30c7\u30fc\u30bf\u3092\u767b\u9332<br \/>\n            string file = Application.StartupPath + &#8220;\\\\1.jpg&#8221;;<br \/>\n            byte[] imgBody = File.ReadAllBytes(file);<\/p>\n<p>            int no = 0;<br \/>\n            using (var con = new FbConnection(gro.conString))<br \/>\n            {<br \/>\n                try<br \/>\n                {<br \/>\n                    using (FbCommand cmd = con.CreateCommand())<br \/>\n                    {<br \/>\n                        con.Open();<br \/>\n                        string sql = &#8220;&#8221;;<br \/>\n                        \/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u958b\u59cb<br \/>\n                        var tran = con.BeginTransaction();<br \/>\n                        cmd.Transaction = tran;<\/p>\n<p>                        \/\/ \u30c7\u30fc\u30bf\u767b\u9332<br \/>\n                        cmd.CommandText = @&#8221;INSERT INTO chatGPT (inpData,title,question,answer,remarks,imgBody) VALUES (@inpData,@title,@question,@answer,@remarks,@imgBody) &#8220;;<\/p>\n<p>                        cmd.Parameters.Add(&#8220;@inpData&#8221;, FbDbType.TimeStamp).Value = DateTime.Now.ToString(&#8220;yyyy\/MM\/dd HH:mm&#8221;);<br \/>\n                        cmd.Parameters.Add(&#8220;@title&#8221;, FbDbType.VarChar).Value = &#8220;&#8221;;<br \/>\n                        cmd.Parameters.Add(&#8220;@question&#8221;, FbDbType.VarChar).Value = &#8220;&#8221;;<br \/>\n                        cmd.Parameters.Add(&#8220;@answer&#8221;, FbDbType.VarChar).Value = &#8220;&#8221;;<br \/>\n                        cmd.Parameters.Add(&#8220;@remarks&#8221;, FbDbType.VarChar).Value = &#8220;&#8221;;<br \/>\n                        cmd.Parameters.Add(&#8220;@imgBody&#8221;, FbDbType.Binary).Value = imgBody;<br \/>\n                        cmd.ExecuteNonQuery();<br \/>\n                        \/\/ \u3053\u3053\u3067\u30b3\u30df\u30c3\u30c8<br \/>\n                        tran.Commit();<br \/>\n                    }<\/p>\n<p>                }<br \/>\n                catch (Exception ex)<br \/>\n                {<br \/>\n                    noby.Message(ex.ToString(), m.Stop);<br \/>\n                }<br \/>\n                finally<br \/>\n                {<br \/>\n                    con.Close();<br \/>\n                }<\/p>\n<p>            }<\/p>\n<p>        }<\/p>\n<p>private void button7_Click(object sender, EventArgs e)<br \/>\n        {<br \/>\n            \/\/\u767b\u9332\u3057\u305f\u753b\u50cf\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u518d\u751f\u3059\u308b<br \/>\n            try<br \/>\n            {<br \/>\n                int x = gcMultiRowKamoku.CurrentRow.Index;<br \/>\n                string date = gcMultiRowKamoku.GetValue(x, &#8220;textINPDATA&#8221;).ToString();<br \/>\n                byte[] b = (byte[])DB.SelectData(date).Rows[0][&#8220;imgBody&#8221;];<\/p>\n<p>                if (b != null)<br \/>\n                {<br \/>\n                    string file = gro.deskTopFolderString + &#8220;\\\\2.jpg&#8221;;<br \/>\n                    Image newImage = Func.ByteArrayToImage(b);<br \/>\n                    \/\/\u30d5\u30a1\u30a4\u30eb\u62e1\u5f35\u5b50\u306e\u78ba\u8a8d<br \/>\n                    if (newImage.RawFormat.Equals(ImageFormat.Jpeg))<br \/>\n                    {<br \/>\n                        noby.Message(&#8220;Jpeg&#8221;);<br \/>\n                    }<\/p>\n<p>                    if (newImage.RawFormat.Equals(ImageFormat.Png))<br \/>\n                    {<br \/>\n                        noby.Message(&#8220;Png&#8221;);<br \/>\n                    }<br \/>\n                    newImage.Save(file);<br \/>\n                }<\/p>\n<p>            }<br \/>\n            catch (DirectoryNotFoundException)<br \/>\n            {<br \/>\n                noby.Message(&#8220;\u8aad\u307f\u51fa\u3059\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u307e\u305b\u3093&#8221;);<\/p>\n<p>            }<br \/>\n            catch (Exception ex)<br \/>\n            {<br \/>\n                noby.Message(ex.ToString(), m.Stop);<\/p>\n<p>            }<br \/>\n        }<\/p>\n","protected":false},"excerpt":{"rendered":"<p>private void button8_Click(object sender, EventArgs e) { \/\/\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u66f4\u65b0\u3059\u308b string file = Application.StartupPath + [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_lightning_design_setting":[],"footnotes":""},"categories":[22],"tags":[],"class_list":["post-1251","post","type-post","status-publish","format-standard","hentry","category-firebird"],"_links":{"self":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/1251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1251"}],"version-history":[{"count":1,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/1251\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=\/wp\/v2\/posts\/1251\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prg.waou.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}