多网卡udp组播,客户端收不到
多网卡udp组播,客户端收不到多网卡组播的时候,发送端要遍历本地ip,给每个ip都发组播包,不能使用"0.0.0.0"。否则有可能收不到。接收端可以绑定"0.0.0.0"进行接收。
代码:发送端http://xssl.online/20220924/cpp/udp%E7%BB%84%E6%92%AD/
接收端http://xssl.online/20220924/cpp/udp%E7%BB%84%E6%92%AD%E6%8E%A5%E6%94%B6/
wordpress增加文章版权说明和浏览次数
在wp-content\themes\里面找到并打开你的主题目录。将下面代码复制到functions.php的最下方,然后刷新页面就可以看到效果。
12345678910111213141516171819202122232425262728// 读取浏览次数function xssl_post_clicks($uid) { return 1+(int) get_post_meta($uid, 'post-clicks', TRUE);}function xssl_copyright($content) { if(is_single() or is_feed()) { global $post; $content.='<div class="post-copyright">'; $content.='<div class="post-copyright__author"><s ...
未能找到程序集“mscorlib.dll”
未能找到程序集“mscorlib.dll”c++使用c#dll时报错:未能找到程序集“mscorlib.dll”: 请使用 /AI 或通过设置 LIBPATH 环境变量指定程序集搜索路径
解决方法:查看C#版本
查看C#路径
找到mscorlib.dll
复制mscorlib.dll到c++项目目录再次编译
qemu-img转换镜像格式
转换镜像文件格式命令:1qemu-img convert -f qcow2 -O raw test.qcow2 test.raw
参数说明:qemu-imgconvert 转换格式-f qcow2 -f的参数值为源镜像文件的格式-O raw O(必须是大写)的参数值为目标镜像格式test.qcow2 源镜像文件名test.raw 目标文件名称
支持的格式有:RAW、qcow2、qcow1、VMDK、VDI、VHD(vpc)、VHDX、QED等
制作ubuntu的img
1 导出ubuntu系统使用VMware导出ubuntu系统,得到grubTest.mf grubTest.ovf grubTest-disk1.vmdk3个文件。
2 使用qemu-img转换镜像格式到raw转换镜像文件格式qemu-img convert -f vmdk -O raw grubTest-disk1.vmdk grubTest-disk1.raw
ue4c++格式化字符串
ue4c++格式化字符串函数说明
Format the specified string using the specified arguments. Replaces instances of {0} with indices from the given array matching the index specified in the token
@param InFormatString A string representing the format expression
@param InOrderedArguments An array of ordered arguments that match the tokens specified in InExpression
@return A string containing the formatted text
1UE_NODISCARD static FString Format(const TCHAR* InFormatString, const FStringFormatOrderedArg ...
ue4c++扫雷做的扫雷demo
源码地址ue4c++扫雷demo,源码在github上
https://github.com/82488059/mine-clearance.git
windows 服务中以用户管理员权限或普通权限启动进程
管理员权限启动进程windows服务中以用户管理员权限或普通权限启动进程
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889// 管理员权限启动进程#ifdef UNICODEMMSYSSHARED_EXPORT bool CreateProcessWithAdmin(const std::wstring& exe, const std::wstring& param, bool show)#elseMMSYSSHARED_EXPORT bool CreateProcessWithAdmin(const std::string& exe, const std::string& param, bool show)#endif // UNICODE{ HAND ...
boost 共享内存 权限
注意使用system创建的共享内存,使用普通用户读取,创建时要设置权限 。12permissions ps;ps.set_unrestricted(); // 0666 使用shared_memory_object创建的共享内存不会随着对象的释放而删除。
使用windows_shared_memory创建的共享内存会随着对象的释放而删除,并且跨用户读取时,共享对象名前面需要加上"Global\\"表名是全局共享内存。
代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768#include <boost/interprocess/shared_memory_object.hpp> #include <boost/interprocess/mapped_region.hpp> #include <boost/interprocess/w ...
c++调用c# dll修改win10锁屏背景
c# dll代码CSharpLib.dll123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.IO;using Windows.Storage;using Windows.System.UserProfile;using Windows.Foundation.Metadata;namespace LockscreenWin10{ public class ...