string sss = string.Format("{0:d8}", 500); MessageBox.Show(sss); return; 代码自动补齐0 转载于:https://www.cnblogs.com/Violety/p/9431216.html