From 1a1c8e71fcd14858f595029f089b2d4a00202b32 Mon Sep 17 00:00:00 2001
From: ogi <Administrator@S-OGI-PC>
Date: Fri, 05 Dec 2025 09:24:16 +0900
Subject: [PATCH] プロジェクトファイルを追加。
---
HotelPms.SourceFactory/FormMain.cs | 724 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 724 insertions(+), 0 deletions(-)
diff --git a/HotelPms.SourceFactory/FormMain.cs b/HotelPms.SourceFactory/FormMain.cs
new file mode 100644
index 0000000..5d00783
--- /dev/null
+++ b/HotelPms.SourceFactory/FormMain.cs
@@ -0,0 +1,724 @@
+using Grpc.Net.Client;
+using Grpc.Net.Client.Web;
+using HotelPms.Data;
+using HotelPms.Data.Client;
+using HotelPms.Data.Common;
+using HotelPms.Data.UseInfo;
+using HotelPms.DataAccessGrpc.Client;
+using HotelPms.Share.Data;
+using HotelPms.Share.NetWork;
+using HotelPms.Share.Util;
+using HotelPms.Share.Windows.Component;
+using HotelPms.Share.Windows.Tool;
+using HotelPms.Share.Windows.Util;
+using HotelPms.SourceFactory.Util;
+using HotelPms.VerUp.DataBase;
+using MailKit.Net.Smtp;
+using MailKit.Security;
+using MimeKit;
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using System.Data;
+using System.Data.Common;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.Json;
+
+namespace HotelPms.SourceFactory
+{
+ public partial class FormMain : FormBase
+ {
+ public FormMain()
+ {
+ InitializeComponent();
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+
+ string file = @"C:\Temp\newdd.xls";
+ if (File.Exists(file)) { File.Delete(file); }
+ File.Copy(@"C:\Users\Administrator\Desktop\AESDemo\AESDemo\temp.xls", file);
+
+ using (NPOIExcel excel = new NPOIExcel(file))
+ {
+ int tmpRow1 = 0;
+ int tmpRow2 = 1;
+
+ //excel.SetCurrentSheet(1);
+ //excel.SetCell("D1", "15");
+ //excel.SetCellComment("D1", "UseNo");
+
+ //一個目の入区分の数でtmpRow2を偏移する
+ int persons = 2;
+ excel.SetCurrentSheet(0);
+
+ for (int i = 1; i <= 2; i++)
+ {
+ excel.Sheet.CopyRow(tmpRow1, tmpRow2 + i);
+ excel.Sheet.GetRow(tmpRow2 + i).Height = excel.Sheet.GetRow(tmpRow1).Height;
+ }
+
+ //CellRangeAddress cellRangeAddress = new CellRangeAddress(tmpRow2 + 1, tmpRow2 + persons, 0, 1);
+ //excel.Sheet.AddMergedRegion(cellRangeAddress);
+
+ //cellRangeAddress = new CellRangeAddress(tmpRow2 + 1, tmpRow2 + persons, 2, 3);
+ //excel.Sheet.AddMergedRegion(cellRangeAddress);
+
+ int r = excel.Sheet.LastRowNum;
+ for (int i = 1; i <= 2; i++)
+ {
+ r += 1;
+ excel.Sheet.CopyRow(tmpRow2, r);
+ excel.Sheet.GetRow(r).Height = excel.Sheet.GetRow(tmpRow2).Height;
+ string col = ((int)(r + 1)).ToString();
+ excel.SetCell("A" + col, col);
+ }
+
+ r = excel.Sheet.LastRowNum + 1;
+ excel.Sheet.CopyRow(tmpRow1, r);
+ excel.Sheet.GetRow(r).Height = excel.Sheet.GetRow(tmpRow1).Height;
+
+ //excel.Sheet.GetRow(tmpRow2).ZeroHeight = true;
+ //excel.Sheet.GetRow(tmpRow1).ZeroHeight = true;
+ excel.Sheet.RemoveRow(excel.Sheet.GetRow(tmpRow2));
+ excel.Sheet.RemoveRow(excel.Sheet.GetRow(tmpRow1));
+
+ excel.Sheet.ShiftRows(2, excel.Sheet.LastRowNum, -2, true, false);
+ }
+
+ Process.Start(@"C:\Temp\newdd.xls");
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ //new PostgreSqlDemo().Show();
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = (HSSFSheet)workbook.CreateSheet("Sheet1");
+ HSSFRow row = (HSSFRow)sheet.CreateRow(0);
+ HSSFCell cell = (HSSFCell)row.CreateCell(0);
+ cell.SetCellValue("Cell1");
+
+ // Create the drawing patriarch (top level container for all shapes including cell comments)
+ IDrawing patriarch = (HSSFPatriarch)sheet.CreateDrawingPatriarch();
+
+ // Client anchor defines size and position of the comment in the worksheet
+ IComment comment = patriarch.CreateCellComment(new HSSFClientAnchor(0, 0, 0, 0, 2, 1, 4, 4));
+
+ // Set comment author
+ comment.Author = "Author";
+
+ // Set text in the comment
+ comment.String = new HSSFRichTextString($"{comment.Author}:{Environment.NewLine}A comment");
+
+ // If you want the author displayed in bold on top like in Excel
+ // The author will be displayed in the status bar when on mouse over the commented cell
+ IFont font = workbook.CreateFont();
+ font.Boldweight = (short)FontBoldWeight.Bold;
+ comment.String.ApplyFont(0, comment.Author.Length, font);
+
+ // Set comment visible
+ comment.Visible = true;
+
+ // Assign comment to a cell
+ cell.CellComment = comment;
+
+ //using (MemoryStream exportData = new MemoryStream())
+ //{
+ // workbook.Write(exportData);
+ // //Response.ContentEncoding = Encoding.UTF8;
+ // //Response.Charset = Encoding.UTF8.EncodingName;
+ // //Response.ContentType = "application/vnd.ms-excel";
+ // //Response.AddHeader("content-disposition", $"attachment; filename=test.xls");
+ // //Response.Clear();
+ // //Response.BinaryWrite(exportData.GetBuffer());
+ // //Response.End();
+ //}
+ }
+
+ private void FormMain_KeyDown(object sender, KeyEventArgs e)
+ {
+
+ }
+
+ private Task<string> GetData()
+ {
+ System.Diagnostics.Debug.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss fff")}】GetData開始");
+ return Task<string>.Run(() =>
+ {
+ Thread.Sleep(20000);
+ return "結果ですよ:" + DateTime.Now.ToString("HH:mm:ss fff");
+ });
+ }
+
+ private Task<string> GetData(object param)
+ {
+ Func<object, string> action = (o) =>
+ {
+ Thread.Sleep((int)o);
+ return "aaaa結果ですよ:" + DateTime.Now.ToString("HH:mm:ss fff");
+ };
+ return new TaskFactory().StartNew<string>(action, param);
+ }
+
+
+ private async void FormMain_Load(object sender, EventArgs e)
+ {
+ this.ActiveControl = LoadingObj;
+ LoadingObj.ShowWaiting();
+ string data = await GetData(2000);
+ textBox1.Text = data;
+ LoadingObj.CloseWaiting();
+
+ Dictionary<string, int> dict = new Dictionary<string, int>();
+ dict["Name"] = 180;
+
+ dict["Name"] = 30;
+ textBox3.Text = $"【{DateTime.Now.ToString("HH:mm:ss fff")}】FormMain_Load準備OK";
+
+ Use item = new()
+ {
+ ID = 1
+ };
+ //var a = item.GetCinDate();
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ new TableToExcel().Show();
+ }
+
+ private void button4_Click(object sender, EventArgs e)
+ {
+ //Json Object
+ var cc = new { ID = 1, Name = "小木", Other = "aaa" };
+ //cc["Name"] = "aa";
+
+
+ string name = cc.Name;
+ int id = cc.ID;
+
+
+
+ new FormGdi().Show();
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ var message = new MimeMessage();
+ message.From.Add(new MailboxAddress("小木勝龍", "liangbenyinjp@yahoo.co.jp"));
+ message.To.Add(new MailboxAddress("小木勝龍", "shr.ogi@sj-sol.com"));
+ message.Subject = "How you doin'?";
+
+ message.Body = new TextPart("plain")
+ {
+ Text = @"Hey Chandler,
+
+I just wanted to let you know that Monica and I were going to go play some paintball, you in?
+
+-- Joey"
+ };
+
+ //using (var client = new SmtpClient())
+ //{
+ // client.ServerCertificateValidationCallback =
+ // (sender, certificate, certChainType, errors) => true;
+ // client.AuthenticationMechanisms.Remove("XOAUTH2");
+
+ // client.Connect("smtp.mail.yahoo.co.jp", 465, true);
+
+ // // Note: only needed if the SMTP server requires authentication
+ // client.Authenticate("liangbenyinjp", "lby10180331");
+
+ // client.Send(message);
+ // client.Disconnect(true);
+ //}
+
+ //GmailのSMTPサーバーアドレス:smtp.gmail.com
+ //GmailのSMTP名:あなたの氏名
+ //GmailのSMTPユーザー名:あなたのGmailアドレス(例:you @gmail.com)
+ //GmailのSMTPパスワード:あなたのGmailのログインパスワード
+ //GmailのSMTPポート(TLS): 587
+ //GmailのSMTPポート(SSL): 465
+
+ using (var mySmtpClient = new SmtpClient())
+ {
+ string host = "smtp.mail.yahoo.co.jp";
+ int port = 465; // 587
+ string userId = "liangbenyinjp";
+ string password = "lby10180331";
+
+ mySmtpClient.Connect(host, port, SecureSocketOptions.Auto);
+ mySmtpClient.Authenticate(new SaslMechanismLogin(userId, password));
+ mySmtpClient.Send(message);
+ mySmtpClient.Disconnect(true);
+ }
+ }
+
+ private void button6_Click(object sender, EventArgs e)
+ {
+ StringBuilder sb = new StringBuilder();
+ for (int i = (int)numericUpDown1.Value; i < (int)numericUpDown2.Value; i++)
+ {
+ sb.AppendLine(string.Format(textBox2.Text, i));
+ }
+ richTextBox1.Text = sb.ToString();
+ }
+
+ private void button7_Click(object sender, EventArgs e)
+ {
+ byte[] data;
+ using (DataTable table = new DataTable())
+ {
+ for (int i = 0; i < 50; i++)
+ {
+ table.Columns.Add($"Fields{i}");
+ }
+
+ for (int r = 0; r < 500; r++)
+ {
+ DataRow row = table.NewRow();
+ table.Rows.Add(row);
+
+ for (int i = 0; i < 50; i++)
+ {
+ row[$"Fields{i}"] = $"データだよData({r},{i})";
+ }
+ }
+ data = Export(table, "xls");
+ }
+ }
+
+ public static byte[] Export(DataTable dt, string type = "xlsx")
+ {
+ const int headerRowIndex = 0;
+
+ // ブック作成
+ IWorkbook book;
+ switch (type)
+ {
+ case "xls":
+ book = new HSSFWorkbook();
+ break;
+ case "xlsx":
+ book = new XSSFWorkbook();
+ break;
+ default:
+ return null;
+ }
+
+ // シート作成
+ var sheet = book.CreateSheet("Table");
+
+ // ヘッダ行作成
+ var headerRow = sheet.CreateRow(0);
+ foreach (DataColumn col in dt.Columns)
+ {
+ ICell cell = headerRow.CreateCell(dt.Columns.IndexOf(col));
+ cell.SetCellValue(col.ColumnName);
+ }
+
+ // データ行作成
+ foreach (DataRow row in dt.Rows)
+ {
+ var dataRow = sheet.CreateRow(headerRowIndex + 1 + dt.Rows.IndexOf(row));
+
+ foreach (DataColumn col in dt.Columns)
+ {
+ var colIndex = dt.Columns.IndexOf(col);
+ if (row[colIndex] == DBNull.Value) continue;
+
+ ICell cell = dataRow.CreateCell(colIndex);
+ cell.SetCellValue(row[colIndex].ToString());
+ }
+ }
+
+
+ // ブックを出力(保存)
+ //using (var ms = new MemoryStream())
+ //{
+ var ms = new MemoryStream();
+ book.Write(ms, true);
+ byte[] data = ms.ToArray();
+ ms.Close();
+
+ File.WriteAllBytes("1.xls", data);
+ return data;
+ //}
+ }
+
+ private void button8_Click(object sender, EventArgs e)
+ {
+ new FormExProperty().Show();
+ }
+
+ private void button9_Click(object sender, EventArgs e)
+ {
+ GC.Collect(); //使う前に一回メモリー回収必要
+ StringBuilder sb = new StringBuilder();
+ foreach (KeyValuePair<Control, ControlPropertyEx> item in ControlPropertyEx.Data)
+ {
+ if (item.Key.IsDisposed)
+ {
+ sb.AppendLine($"IsDisposed⇒{item.Value}");
+ }
+ else
+ {
+ sb.AppendLine($"{item.Key.Name}({item.Key.Handle})⇒{item.Value}");
+ }
+ }
+ richTextBox1.Text = sb.ToString();
+ }
+
+ private void button10_Click(object sender, EventArgs e)
+ {
+ new FormReport().Show();
+ }
+
+ private void button11_Click(object sender, EventArgs e)
+ {
+ string a = string.Empty;
+ for (int i = 0; i < int.MaxValue; i++)
+ {
+ a += "s";
+ System.Diagnostics.Debug.WriteLine(i);
+ }
+
+ System.Diagnostics.Debug.WriteLine(a.Length);
+ }
+
+ private void button12_Click(object sender, EventArgs e)
+ {
+ using (DBLogin login = new DBLogin())
+ {
+ if (login.ShowDialog() != DialogResult.OK) { return; }
+ EnvironmentSetting.Default.DataBase = new Share.Data.DBConnectItem(login.DataSource, login.Catalog, login.UseID, login.PassWord);
+ }
+
+ using (BeanCreator form = new BeanCreator())
+ {
+ form.ShowDialog();
+ }
+ }
+
+ private void button13_Click(object sender, EventArgs e)
+ {
+ new FormEdge().Show();
+ }
+
+ private void button14_Click(object sender, EventArgs e)
+ {
+ new FormSignalR().Show();
+ }
+
+ private void FetchReport(DbDataReader reader, List<TestBean> data)
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["ID"]),
+ Name = reader["Name"].ToString()
+ };
+ data.Add(testBean);
+ }
+ }
+
+ private void FetchRoomType(DbDataReader reader, List<TestBean> data)
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["RoomTypeNo"]),
+ Name = reader["RoomTypeName"].ToString()
+ };
+ data.Add(testBean);
+ }
+ }
+
+ private void button15_Click(object sender, EventArgs e)
+ {
+ using (MsSqlNet msSqlNet = new MsSqlNet("localhost", "sa", "oatcti", "HotelPms"))
+ {
+ var result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM M_Room", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ var testBean = new TestBean
+ {
+ ID = CConvert.ToInt(reader["ID"]),
+ Name = reader["Name"].ToString()
+ };
+ data.Add(testBean);
+ }
+ });
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+
+ var demo = msSqlNet.GetDataReader<List<HotelPms.Data.Master.Demo>>(@"SELECT ID,[Name],FInt,FTinyInt,FSmallInt,FFloat,FBit,FDecimal,FDate,UpdateDate,UpdateID FROM M_Demo", (reader, data) =>
+ {
+ while (reader.Read())
+ {
+ var testBean = new HotelPms.Data.Master.Demo();
+ testBean.ConvertReader(reader);
+ System.Diagnostics.Debug.WriteLine(testBean.ToText());
+ data.Add(testBean);
+ }
+ });
+
+
+ result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM S_Report", FetchReport);
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+
+ result = msSqlNet.GetDataReader<List<TestBean>>("SELECT * FROM M_RoomType", (reader, data) => FetchRoomType(reader, data));
+
+ if (result == null) { return; }
+
+ foreach (TestBean item in result)
+ {
+ System.Diagnostics.Debug.WriteLine($"{item.ID}.{item.Name}");
+ }
+ }
+ }
+
+ private void button16_Click(object sender, EventArgs e)
+ {
+ CalendarSelectorOne.Execute(textBox3);
+ }
+
+ private void button17_Click(object sender, EventArgs e)
+ {
+ CalendarSelector.Execute(textBox3);
+ }
+
+ private void FormMain_Shown(object sender, EventArgs e)
+ {
+ richTextBox1.Text = $"【{DateTime.Now.ToString("HH:mm:ss fff")}】FormMain_Shown準備OK";
+ }
+
+ private void button18_Click(object sender, EventArgs e)
+ {
+ new FormValid().Show();
+ }
+
+ private void button19_Click(object sender, EventArgs e)
+ {
+ new ExcelToTable().Show();
+ }
+
+ private void button20_Click(object sender, EventArgs e)
+ {
+ new FormScript().Show();
+ }
+
+ private async void button21_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpClientHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://localhost:7228", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ //GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ //DataSet ds = grpcSet.ToDataSet();
+
+ //using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ //{
+ // DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ //}
+ }
+ }
+
+ private void button22_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, httpClientHandler);
+ //var httpClient = new HttpClient(httpClientHandler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler //httpClientHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://localhost:7240", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = client.SayHello(request);
+ richTextBox1.Text = reply.ToString();
+ }
+ }
+
+ private async void button23_Click(object sender, EventArgs e)
+ {
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var handler = new SubdirectoryHandler(httpClientHandler, "/grpc");
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, handler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://www.navc2.net", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "IIS CALLだぞ ";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+ }
+ }
+
+ private void button24_Click(object sender, EventArgs e)
+ {
+ new ExcelCopy().Show();
+ }
+
+ private void button25_Click(object sender, EventArgs e)
+ {
+ using (DBCore core = new DBCore(new DBConnectItem("localhost", "HotelPms", "sa", "oatcti")))
+ {
+ core.Output += Core_Output;
+ core.Execute();
+ }
+ MessageBox.Show("OK");
+ }
+
+ private void Core_Output(object sender, MessageEventArgs e)
+ {
+ richTextBox1.AppendText(Environment.NewLine);
+ richTextBox1.AppendText(e.Message);
+ }
+
+ private void button26_Click(object sender, EventArgs e)
+ {
+ var serializerOptions = new JsonSerializerOptions
+ {
+ Converters = { new DynamicJsonConverter() },
+ WriteIndented = true
+ };
+
+ var jsonText = File.ReadAllText("sample.json");
+
+ dynamic obj = JsonSerializer.Deserialize<dynamic>(jsonText, serializerOptions);
+
+ string id = obj.id;
+ string type = obj.type;
+
+ string json = JsonSerializer.Serialize(obj, serializerOptions);
+
+ obj = new { ID = 1, Name = "aaa" };
+ json = JsonSerializer.Serialize(obj, serializerOptions);
+
+ }
+
+ private async void button27_Click(object sender, EventArgs e)
+ {
+ //AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var handler = new SubdirectoryHandler(httpClientHandler, "/grpc");
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWebText, handler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ HttpHandler = httpHandler
+ };
+ //using (var Channel = GrpcChannel.ForAddress("https://www.navc2.net", options))
+ using (var Channel = GrpcChannel.ForAddress("https://ginbow.eu.org", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "IIS CALLだぞ ";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ DataSet ds = grpcSet.ToDataSet();
+
+ using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ {
+ DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ }
+ }
+ }
+
+ private async void button28_Click(object sender, EventArgs e)
+ {
+ //Content-Type application/grpc
+ var httpClientHandler = new HttpClientHandler();
+ httpClientHandler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
+ var httpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, httpClientHandler);
+ GrpcChannelOptions options = new GrpcChannelOptions()
+ {
+ MaxReceiveMessageSize = int.MaxValue,
+ //HttpHandler = httpClientHandler
+ HttpHandler = httpHandler
+ };
+ using (var Channel = GrpcChannel.ForAddress("https://ginbow.eu.org", options))
+ {
+ HelloRequest request = new HelloRequest();
+ request.Name = "aaa";
+ var client = new Greeter.GreeterClient(Channel);
+ HelloReply reply = await client.SayHelloAsync(request);
+ richTextBox1.Text = reply.ToString();
+
+ GrpcSet grpcSet = await GrpcClient.GetDataSet(Channel, (int)ESetActionType.ColSetting, $"localhost,Web,10000");
+ DataSet ds = grpcSet.ToDataSet();
+
+ using (RoomViewLayoutAccess access = new RoomViewLayoutAccess(Channel))
+ {
+ DataSet ds1 = await access.GetRoomViewData($"2022/07/13,1");
+ }
+ }
+ }
+
+ private void button29_Click(object sender, EventArgs e)
+ {
+ Process.Start(new ProcessStartInfo
+ {
+ FileName = "cmd",
+ Arguments = $"/c start \"\" \"notepad.exe\"",
+ CreateNoWindow = true,
+ UseShellExecute = false
+ });
+
+ //Process.Start(new ProcessStartInfo
+ //{
+ // FileName = "notepad.exe",
+ // Arguments = @"c:\temp\LabelPrinterUtility.ini", // 虽然打不开内容,但能验证是否递归
+ // UseShellExecute = true
+ //});
+ }
+
+ private void button30_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
--
Gitblit v1.10.0