//11.txt
//{"param":{"loginid":"admin","pwd":"admin123"},"proto":"r","sender":"/cli/admin/10.1.181.79/25216","id":"login_client.0000919860.001","ts":"1713428639","method":"login_client"}

using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

class Program
{
    public static void Main(string[] args)
    {
        if (args.Length == 1)
        {
            CHKNM nmm = new CHKNM();
            nmm.RUN(args[0]);
        }
        else
        {
            CHKNM nmm = new CHKNM();
            nmm.RUN();
        }
    }
}
class CHKNM
{
    public void RUN(string fileText)
    {
        string lines = File.ReadAllText(fileText);

        Console.WriteLine(lines);

        byte[] bytes = Encoding.UTF8.GetBytes(lines);
        PrintByteArray(bytes);
    }
    public void RUN()
    {
        byte[] buffer = new byte[] { 123, 34, 112, 97, 114, 97, 109, 34, 58, 123, 34, 108, 111, 103, 105, 110, 105, 100, 34, 58, 34, 97, 100, 109, 105, 110, 34, 44, 34, 112, 119, 100, 34, 58, 34, 97, 100, 109, 105, 110, 49, 50, 51, 34, 125, 44, 34, 112, 114, 111, 116, 111, 34, 58, 34, 114, 34, 44, 34, 115, 101, 110, 100, 101, 114, 34, 58, 34, 47, 99, 108, 105, 47, 97, 100, 109, 105, 110, 47, 49, 48, 46, 49, 46, 49, 56, 49, 46, 55, 57, 47, 50, 53, 50, 49, 54, 34, 44, 34, 105, 100, 34, 58, 34, 108, 111, 103, 105, 110, 95, 99, 108, 105, 101, 110, 116, 46, 48, 48, 48, 48, 57, 49, 57, 56, 54, 48, 46, 48, 48, 49, 34, 44, 34, 116, 115, 34, 58, 34, 49, 55, 49, 51, 52, 50, 56, 54, 51, 57, 34, 44, 34, 109, 101, 116, 104, 111, 100, 34, 58, 34, 108, 111, 103, 105, 110, 95, 99, 108, 105, 101, 110, 116, 34, 125, 13, 10, };
        string strText = Encoding.Default.GetString(buffer);

        Console.WriteLine(strText);
    }
    public void PrintByteArray(byte[] bytes)
    {
        var sb = new StringBuilder("new byte[] { ");
        foreach (var b in bytes)
        {
            sb.Append(b + ", ");
        }
        sb.Append("}");
        Console.WriteLine(sb.ToString());
    }
}





+ Recent posts