当前位置:网站首页>RestfulAPI——C#——增加header用户名密码验证
RestfulAPI——C#——增加header用户名密码验证
2022-07-29 02:28:00 【LtMamba】
一、验证部分代码
public bool securityFun()
{
bool resulT = false;
var headers = WebOperationContext.Current.IncomingRequest.Headers; //获取请求头的代码段
string userName = headers.Get("UserName");
string passWord = headers.Get("PassWord");
if (userName.Equals("test") && passWord.Equals("test"))
{
resulT = true;
}
return resulT;
}
边栏推荐
- owt-server源码剖析(四)--video模块分析之Mixer Out
- QT qstringlist usage
- Some new ideas about time complexity
- Read the recent trends of okaleido tiger and tap the value and potential behind it
- Happy childhood
- h. 264 code stream explanation
- New conch movie theme template m3.1 fully decrypted version multifunctional apple cmsv10 background adaptive theme open source fully decrypted version
- IOT components
- [untitled]
- 自动分账系统哪家好?
猜你喜欢

C language: Little Lele and hexadecimal conversion

Interpretation of ue4.25 slate source code

【OpenCV】使用OpenCV调用手机摄像头

6-21 vulnerability exploitation MySQL weak password cracking

漫画算法_小灰灰面试

Multiple inheritance and derived class member identification

Understand the evolution of redis architecture in one article

STP协议(生成树协议)

Redis master-slave mode, sentinel cluster, fragment cluster

图书管理系统
随机推荐
Implementation principle of golang synergy
云开发口袋工具箱微信小程序源码
Tesla neural network model hydranet
Flink生产环境经典问题汇总
h. 264 code stream explanation
【OpenCV】使用OpenCV调用手机摄像头
IOT components
ROS2/ROS1开发过程中的一些记录
以科技传递温度,vivo亮相数字中国建设峰会
10. Writing rules - Document Search
Ffmpeg+sdl+qt is a simple video player
新版海螺影视主题模板M3.1全解密版本多功能苹果CMSv10后台自适应主题开源全解密版
ASEMI整流桥S25VB100,S25VB100参数,S25VB100应用
FFmpeg+SDL+QT实现简单是视频播放器
第九天笔记
How to migrate thinkphp5 projects to Alibaba cloud function computing to cope with traffic peaks?
12.书写规则-静态模式
K210 - sound source location and sound recognition
HTB-Blocky
Redis master-slave mode, sentinel cluster, fragment cluster