如果你是程序员,你正在用Windows Live Writerl来写blog,想在你的blog里插入代码,我推荐这个好用的插件:
Code Snippet 官方地址 DBank网盘下载
测试一下,看看效果如何。
1: unsafe public static int AFCDirectoryRead(void* conn, void* dir, ref byte[] buffer) 2: { 3: 4: int ret; 5: 6: void* ptr = null; 7: ret = AFCDirectoryRead(conn, dir, ref ptr); 8: if ((ret == 0) && (ptr != null)) 9: { 10: IntPtr ipPtr = new IntPtr(ptr); 11: ArrayList bufferArray = new ArrayList(); 12: 13: int curr = 0; 14: while (true) 15: { 16: byte tmpByte = Marshal.ReadByte(ipPtr, curr); 17: if (tmpByte != 0) 18: { 19: bufferArray.Add(tmpByte); 20: curr++; 21: } 22: else 23: { 24: break; 25: } 26: } 27: 28: buffer = (byte[]) bufferArray.ToArray(typeof (byte)); 29: 30: } 31: else 32: { 33: buffer = null; 34: } 35: return ret; 36: }转载于:https://www.cnblogs.com/chickencake/archive/2011/01/19/1938807.html
相关资源:每个开发人员现在应该下载的十种必备工具之SnippetCompiler_3.0.2