码迷,mamicode.com
首页 >  
搜索关键字:marshal    ( 97个结果
golang map并发读写异常导致服务崩溃
昨天突然接到报警说服务端口丢失,也就是服务崩溃了。 1, 先看错误日志,发现是调用json.Marshal时出错了,错误原因是:concurrent map iteration and map write,即并发读写map。 2, xxx/custom.go的85行 if jsonParamsByt ...
分类:其他好文   时间:2020-03-05 13:15:02    阅读次数:74
Marshal.PtrToStringAnsi中文乱码
Marshal.PtrToStringAnsi中文乱码 出错代码: string dec = Marshal.PtrToStringAnsi(audioOutput.psz_description);//输出 鎵0鍣?(Realtek High Definition Audio) 原因: 查看内存 ...
分类:其他好文   时间:2020-01-28 17:28:49    阅读次数:66
c# 获得当前打开的word 文档
Microsoft.Office.Interop.Word.Application wdApp = (Microsoft.Office.Interop.Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("W... ...
分类:Windows程序   时间:2019-12-30 11:42:44    阅读次数:193
.NET强制停止windows服务
[StructLayout(LayoutKind.Sequential)] internal sealed class SERVICE_STATUS_PROCESS { [MarshalAs(UnmanagedType.U4)] public uint dwServiceType; [Marshal ...
分类:Windows程序   时间:2019-11-08 12:40:24    阅读次数:137
知道内存中一个图片的指针IntPtr大小,转换成图片显示
//nSize 为总长度//pImageData 为总数据//nImageSize //一个图片的长度 byte[] _bytes = new byte[nImageSize];// //IntPtr infosIntptr = Marshal.AllocHGlobal(pImageData); M... ...
分类:其他好文   时间:2019-10-30 11:47:10    阅读次数:335
go json解析Marshal和Unmarshal
Decoder: python package main import ( "encoding/json" "fmt" "io" "log" "strings" ) func main ( ) { const jsonStream = ` { "Name" : "Ed" , "Text" : "Kn ...
分类:Web程序   时间:2019-09-10 17:37:20    阅读次数:134
Go的json解析:Marshal与Unmarshal
简介Json(Javascript Object Nanotation)是一种数据交换格式,常用于前后端数据传输。任意一端将数据转换成json 字符串,另一端再将该字符串解析成相应的数据结构,如string类型,strcut对象等。 go语言本身为我们提供了json的工具包”encoding/jso ...
分类:Web程序   时间:2019-09-04 21:25:23    阅读次数:146
JSON、XML序列化与反序列化
序列化pa := &Address{"家","太原","中国"}wa := &Address{"工作","昆山","江苏"}vc := &VCard{"王","剑英",[]*Address{pa,wa},"啊哈哈"}js,_ := json.Marshal(vc)//编码生成js([]byte),在 ...
分类:Web程序   时间:2019-08-21 20:07:08    阅读次数:151
条码打印
IntPtr ver; ver = lixiang.B_Get_DLL_Version(0); strmsg += Marshal.PtrToStringAnsi(ver); ...
分类:其他好文   时间:2019-05-28 15:42:38    阅读次数:81
struct对象的序列化和反序列化
packagemainimport("encoding/xml""fmt")typepersonstruct{NamestringAgeint}funcmain(){p:=person{Name:"张三",Age:18}//无缩进生成xmlifdata,err:=xml.Marshal(p);err!=nil{fmt.Println(err)return}else{//注意,else也在ifdat
分类:其他好文   时间:2019-03-12 12:35:48    阅读次数:163
97条   上一页 1 2 3 4 ... 10 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!