91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 248KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-14
  • 語言: C#
  • 標(biāo)簽: HTTPS??HTTP??SSL??Netsh??Listen??

資源簡介

1、用C#的exe程序,搭建HTTPS監(jiān)聽,可用于靜態(tài)網(wǎng)站、接口、模擬WebApi等等 2、由于是客戶端EXE,可以正常訪問客戶端所有硬件資源 3、如:web界面上調(diào)用http://localhost:xx/+參數(shù),調(diào)用本地硬件、本地緩存(內(nèi)存或文件,可 代替cookies)、打開本地程序、調(diào)用打印機(jī)、掃碼墩....

資源截圖

代碼片段和文件信息

using?System;

public?class?test
{
????public?test()
????{
????????System.Net.HttpListener?httpListener?=?new?System.Net.HttpListener();
????????httpListener.AuthenticationSchemes?=?System.Net.AuthenticationSchemes.Anonymous;
????????httpListener.Prefixes.Add(“https://*:443/“);
????????httpListener.Start();
????????new?System.Threading.Thread(new?System.Threading.ThreadStart(delegate
????????{
????????????while?(true)
????????????{
????????????????try
????????????????{
????????????????????System.Net.HttpListenerContext?httpListenerContext?=?httpListener.GetContext();
????????????????????new?System.Threading.Thread(new?System.Threading.ParameterizedThreadStart((input)?=>
????????????????????{
????????????????????????System.Net.HttpListenerContext?ctx?=?(System.Net.HttpListenerContext)input;
????????????????????????System.Net.HttpListenerRequest?request?=?ctx.Request;
????????????????????????string?pram?=?request.QueryString[“Data“];//Get入?yún)?
????????????????????????string?responseMessage?=?string.Empty;//返回值
????????????????????????if?(!string.IsNullOrEmpty(pram))
????????????????????????{
????????????????????????????//Get入?yún)ⅲ瑄rl解密
????????????????????????????pramOrg?=?pram;
????????????????????????????pram?=?System.Web.HttpUtility.UrlDecode(pram);
????????????????????????}

????????????????????????//POST入?yún)?br/>????????????????????????if?(request.HttpMethod?==?“POST“)
????????????????????????{
????????????????????????????isPost?=?true;
????????????????????????????//處理業(yè)務(wù)請求
????????????????????????????StreamReader?reader?=?new?StreamReader(request.InputStream?Encoding.UTF8);
????????????????????????????pram?=?reader.ReadToEnd();
????????????????????????????reader.Close();
????????????????????????????reader.Dispose();
????????????????????????}

????????????????????????#region?業(yè)務(wù)處理
????????????????????????try
????????????????????????{
????????????????????????????//業(yè)務(wù)處理
????????????????????????????responseMessage?=?“業(yè)務(wù)結(jié)果“;
????????????????????????}
????????????????????????catch?(Exception?ex)
????????????????????????{
????????????????????????????//異常處理
????????????????????????????responseMessage?=?ex.Message;
????????????????????????}
????????????????????????#endregion?業(yè)務(wù)處理
????????????????????????#region?返回給調(diào)用者
????????????????????????//輸出類型
????????????????????????httpListenerContext.Response.ContentType?=?“text/html;?charset=UTF-8“;
????????????????????????//返回狀態(tài)
????????????????????????httpListenerContext.Response.StatusCode?=?200;
????????????????????????//設(shè)置授權(quán),嘗試解決Jquery跨域問題
????????????????????????//httpListenerContext.Response.Headers[“Access-Control-Allow-Origin“]?=?“*“;
????????????????????????//httpListenerContext.Response.Headers[“Access-Control-Allow-Methods“]?=?“GETPOST“;
????????????????????????//httpListenerContext.Response.Headers[“Access-Control-Max-Age“]?=?“1000“;
????????????????????????try
????????????????????????{
????????????????????????????//輸出界面內(nèi)容
????????????????????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????296071??2019-09-05?17:57??HTTPS證書創(chuàng)建+綁定端口+C#程序監(jiān)聽.pdf

?????文件???????3970??2019-09-05?17:59??test.cs

-----------?---------??----------?-----??----

???????????????300041????????????????????2


評論

共有 條評論