1.方法定义

/// <summary>
/// 十进制转换
/// </summary>
/// <param name="hexChar"></param>
/// <returns></returns>
public static int HexChar2Value(string hexChar)
{
switch (hexChar)
{
case "":
case "":
case "":
case "":
case "":
case "":
case "":
case "":
case "":
case "":
return Convert.ToInt32(hexChar);
case "a":
case "A":
return ;
case "b":
case "B":
return ;
case "c":
case "C":
return ;
case "d":
case "D":
return ;
case "e":
case "E":
return ;
case "f":
case "F":
return ;
default:
return ;
}
}
 public int Hex2Ten(string hex)
{
int ten = ;
for (int i = , j = hex.Length - ; i < hex.Length; i++)
{
ten += HexChar2Value(hex.Substring(i, )) * ((int)Math.Pow(, j));
j--;
}
return ten;
}


2.方法调用 (ushort)con.Hex2Ten(con.headset_vid), (ushort)con.Hex2Ten(con.headset_pid)

最新文章

  1. Sublime Text 3实用快捷键大全
  2. Progress.js – 为页面上的任意对象创建进度条效果
  3. Win7激活工具|OEM小马激活
  4. iTool拷贝app到电脑上
  5. DuiLib学习笔记3——颜色探究
  6. Visual Studio的Web Performance Test提取规则详解(2)
  7. 关于软件开发中兼容win7注册表的解决方案
  8. ASP.NET MVC5学习笔记之Filter提供体系
  9. RMI、Hessian、Burlap、Httpinvoker、WebService的比较
  10. iOS开发The Operation couldn&#39;t be completed.(LaunchServicesError error 0.)的解决方法
  11. w3c School
  12. 浅谈ST表
  13. Benchmarking Apache Kafka: 2 Million Writes Per Second (On Three Cheap Machines)
  14. 如何把web.xml中的context-param、Servlet、Listener和Filter定义添加到SpringBoot中
  15. JAVA首次课堂测试总结
  16. f5 主备模式切换
  17. Codeforces Round #514 (Div. 2) D. Nature Reserve
  18. 那天有个小孩教我WCF[一][2/3]
  19. robotium测试创建java文件和junit文件区别
  20. 调研android开发环境的发展演变

热门文章

  1. 关于paths.get()方法的参数的使用
  2. 服务器学习--Linux基本操作指令
  3. python安装第三方库--换镜像源
  4. Linux 换 jdk 版本 环境没有生效
  5. openpose开发(1)官方1.5版本源码编译
  6. Vue 实现点击展开收起
  7. 8259A的初始化(多片)
  8. ESA2GJK1DH1K基础篇: Android实现MQTT封装源码使用说明
  9. Office Tool Plus 安装Office
  10. [Gamma]Scrum Meeting#5