惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
H
Hacker News: Front Page
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
T
Tenable Blog
G
Google Developers Blog
A
About on SuperTechFans
The Cloudflare Blog
S
Securelist
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Forbes - Security
Forbes - Security
腾讯CDC
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Vulnerabilities – Threatpost
IT之家
IT之家
博客园_首页
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Project Zero
Project Zero
月光博客
月光博客
NISL@THU
NISL@THU
爱范儿
爱范儿
S
Secure Thoughts
K
Kaspersky official blog
Security Latest
Security Latest
T
Tailwind CSS Blog
博客园 - Franky
D
Darknet – Hacking Tools, Hacker News & Cyber Security
TaoSecurity Blog
TaoSecurity Blog
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
S
SegmentFault 最新的问题
H
Help Net Security
T
Tor Project blog
L
LINUX DO - 热门话题
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
O
OpenAI News
S
Schneier on Security

博客园 - 码 头

实测有效:Win11右键默认显示更多设置教程 netcore 并发锁 多线程中使用SemaphoreSlim HTML转义字符大全 .Net Core后台任务启停(BackgroundService) 常见的JavaScript的循环处理数据方法 Linux下.NET Core进程守护设置,解决SSH关闭后.NET Core服务无法访问的问题 记录 IIS 部署vue 项目步骤 AspNetCoreApi 跨域处理(CORS ) .NET CORE 使用Session报错:Session has not been configured for this application or request 小豆苗疫苗辅助搜索 日期函数(sql) 图片javascript缩小 c# DESEncrypt 加密、解密算法 二分法算法 MVC拦截器记录操作用户日志 最全的Resharper快捷键汇总 如何将数据库中的表导入到PowerDesigner中 修复IE9.0下PlaceHolder 属性问题js脚本 sql脚本查询日期时间段日期
汉字编码问题转换
码 头 · 2016-07-15 · via 博客园 - 码 头
using System;
class DistrictCode
{
	public static void Main(string[] args)
	{
		while(true)
		{
			Console.Write("请输入(输入“E”退出):");
			string inputString =Console.ReadLine();
			if(iSnputString=="e"||inputString=="E")
			{
				break;
			}
			else
			{
				Console.WriteLine(TextTOQwm(inputString));
			}
		}
	}
	public static string TextTOQwm(string character)
	{
		string coding="";
		int i1=0;
		int i2=0;
		int i3=0;
		for(int i=0;i<character.Length;i++)
		{
			byte [] bytes=System.Text.Encoding.Default.GetBytes(character.Substring(i,1));
			i1=(short)(bytes[0]);
			if(bytes.Length!=1)
			{
				i2=(short)(bytes[1]);
				i3=1;
			}
			else
			{
				i2=65536;
				i3=-1;
			}
			int chrasc=i1*256+i2-65536;
			if(chrasc>0 && chrasc<160)
			{
				Console.WriteLine("只能输入汉字");
			}
			else
			{
				if(i3==-1)
				{
					Console.WriteLine("只能输入汉字");
				}
				else
				{
					string lowCode=System.Convert.ToString(Math.Abs
					(Convert.ToInt32(System.Convert.ToString(bytes[0]))-160));
					if(lowCode.Length==1)
					{
						lowCode="0"+lowCode;
					}
					string hightCode=System.Convert.ToString(Math.Abs
					(Convert.ToInt32(System.Convert.ToString(bytes[1]))-160));
					if(hightCode.Length==1)
					{
						hightCode="0"+hightCode;
					}
					coding+=character.Substring(i,1)+(lowCode+hightCode);
				}
			}
		}
		return coding;
	}
}