当前位置:网站首页>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;
}
边栏推荐
- What are the TCP retransmission mechanisms?
- Understanding service governance in distributed development
- 并发模式之生产者消费者模式
- Teach you how to install vscode by hand (with illustrated steps)
- 第五天实验
- (作业)C语言:atoi和strncpy、strncat、strncmp的模拟实现
- 漫画算法_小灰灰面试
- ECCV 2022 | airdet: a small sample target detection method without fine tuning
- Stm32f103xx firmware function library-1
- Happy childhood
猜你喜欢

一款好看的iapp捐赠榜单源码

A good-looking IAPP donation list source code

Redis master-slave mode, sentinel cluster, fragment cluster

【报错】node:internal/modules/cjs/loader:936 【解决方法】

Rocbos open source micro community light forum source code

PHP幸运抽奖系统带后台源码

HTB-Blocky

网络基础概论

C language: Little Lele and Euclid

Asemi rectifier bridge s25vb100, s25vb100 parameters, s25vb100 application
随机推荐
Cloud development pocket toolbox wechat applet source code
并发模式之生产者消费者模式
UE4.25 Slate源码解读
Redis队列实现秒杀
C language: hollow square pattern
自动分账系统哪家好?
Teach you how to install vscode by hand (with illustrated steps)
Ordinary happiness
别人的快乐
白马过隙的时光
Qt编写物联网管理平台48-特色功能设计
漫画算法_小灰灰面试
家庭亲戚关系计算器微信小程序源码
第七天笔记
Others' happiness
[error reporting] node:internal/modules/cjs/loader:936 [solution]
践踏---离散化+树状数组+差分
DataGrip 如何导出和恢复整个数据库数据,使用单个 SQL 文件
新版海螺影视主题模板M3.1全解密版本多功能苹果CMSv10后台自适应主题开源全解密版
STM32C8T6编码器电机测速与arduino光电模块测速