docker 打包失败,
Err:1 http://mirrors.aliyun.com/debian bullseye InRelease Temporary failure resolving 'mirrors.aliyun.com'
解决方案:
在docker 的 daemon.json 中加入如下配置:
swagger 无法对类的对象属性设置为只读方法的解决方案。
只需要在属性所对应的类上设置[SwaggerSchema(Readonly=true)]即可,同时在属性上也加上这个标签。
C# 如何将子网掩码转换为数值
https://stackoverflow.com/questions/8711522/calculating-the-number-of-bits-in-a-subnet-mask-in-c-sharp
C# 如何获取网卡列表、及网卡关联的子网掩码、IP地址
List networks = new List(); NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); networks = networkInterfaces.Select(m => m.Name + ":" + (m.GetIPProperties().GatewayAddresses.Count > 0 ? m.GetIPProperties().GatewayAddresses[0].Address.MapToIPv4() : string.Empty) + ":" + (m.GetIPProperties().UnicastAddresses.FirstOrDefault(n=>n.Address.AddressFamily==AddressFamily.InterNetwork).Address.MapToIPv4())+":"+ m.GetIPProperties().UnicastAddresses.FirstOrDefault(n => n.Address.AddressFamily == AddressFamily.InterNetwork).IPv4Mask.MapToIPv4()).ToList();
List networks = new List();
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
networks = networkInterfaces.Select(m => m.Name + ":" + (m.GetIPProperties().GatewayAddresses.Count > 0 ? m.GetIPProperties().GatewayAddresses[0].Address.MapToIPv4() : string.Empty) + ":" + (m.GetIPProperties().UnicastAddresses.FirstOrDefault(n=>n.Address.AddressFamily==AddressFamily.InterNetwork).Address.MapToIPv4())+":"+ m.GetIPProperties().UnicastAddresses.FirstOrDefault(n => n.Address.AddressFamily == AddressFamily.InterNetwork).IPv4Mask.MapToIPv4()).ToList();
C# 中如何实现四舍五入保留小数位的时候对于整数值保留原样输出呢(小数点后不自动带0)。
double number = 10;
string str = number.ToString("0.###"); //这样如果原先就是一个整数值,那么就直接输出整数值,不会带0,3个#号表示保留3位小数,3位中只保留不为0的数字
mysql 互为主从实现方法。
需要注意的是,mysql 8.0 及后续版本给用户授权和创建不能一起做,必须分开创建
create user 'sync'@'%' identified by 'sync123456';
grant all privileges on *.* to 'sync'@'%';
flush privileges;
另外同步的时候端口均指定为3306就好了