Ultron.Proxy/Ultron.Proxy/Utils/HtmlUtil.cs

31 lines
823 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace Ultron.Proxy.Utils
{
public static class HtmlUtil
{
public static byte[] GetContent(string html)
{
return Encoding.UTF8.GetBytes(html.ToString());
}
private static byte[] PartternWord = Encoding.ASCII.GetBytes("GET /welcome/");
private static byte[] PartternPostWord = Encoding.ASCII.GetBytes("POST /welcome/");
//GET /welcome
private static bool CompareBytes(byte[] wholeBytes, byte[] partternWord)
{
for (int i = 0; i < partternWord.Length; i++)
{
if (wholeBytes[i] != partternWord[i])
{
return false;
}
}
return true;
}
}
}