昨天突然接到报警说服务端口丢失,也就是服务崩溃了。 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中文乱码 出错代码: string dec = Marshal.PtrToStringAnsi(audioOutput.psz_description);//输出 鎵0鍣?(Realtek High Definition Audio) 原因: 查看内存 ...
分类:
其他好文 时间:
2020-01-28 17:28:49
阅读次数:
66
Microsoft.Office.Interop.Word.Application wdApp = (Microsoft.Office.Interop.Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("W... ...
[StructLayout(LayoutKind.Sequential)] internal sealed class SERVICE_STATUS_PROCESS { [MarshalAs(UnmanagedType.U4)] public uint dwServiceType; [Marshal ...
//nSize 为总长度//pImageData 为总数据//nImageSize //一个图片的长度 byte[] _bytes = new byte[nImageSize];// //IntPtr infosIntptr = Marshal.AllocHGlobal(pImageData); M... ...
分类:
其他好文 时间:
2019-10-30 11:47:10
阅读次数:
335
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
简介Json(Javascript Object Nanotation)是一种数据交换格式,常用于前后端数据传输。任意一端将数据转换成json 字符串,另一端再将该字符串解析成相应的数据结构,如string类型,strcut对象等。 go语言本身为我们提供了json的工具包”encoding/jso ...
分类:
Web程序 时间:
2019-09-04 21:25:23
阅读次数:
146
序列化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
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