string pcname = Dns.GetHostName(); string ip = Dns.GetHostAddresses(pcname).First().ToString(); using Com.AppCode.Extend; using Com.AppCode.Helper; using System.Collections.Generic; using System.Net; using System.Net.NetworkInformation; using System.
看rocketmq源码的时候发现他们还给时钟封装里一下. /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The A
1.使用 MessageFormat 格式化文本 int planet = 7; String event = "a disturbance in the Force"; String result = MessageFormat.format( "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.", planet, new Date(), event); The output