You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
843 B
C#

using Thrift.Protocol;
using Thrift.Transport;
internal class Program
{
private static void Main(string[] args)
{
Console.WriteLine("Hello, Client!");
SendTest("List1");
}
public static void SendTest(string Message)
{
try
{
TTransport transport = new TSocket("localhost", 9091);
transport.Open();
TProtocol protocol = new TBinaryProtocol(transport);
WcsThrift.Client client = new WcsThrift.Client(protocol);
//Console.WriteLine(client.hello("Sunzy"));
Console.WriteLine(client.SendCar(new List<string>() { Message }, "P1001", "10"));
Console.ReadLine();
}
catch (Exception ex)
{
// 处理异常
Console.WriteLine($"Error: {ex.Message}");
}
}
}