static void Main(string[] args) { if (args.Length != 0) { string a = Inc.IsCssOrImg(args[0].ToString()).ToString(); switch (a) { case "img": Inc.ImgToBase64(args[0].ToString()); break; case "css": Inc.Base64ToImg(args[0].ToString(), Inc.GenerateTimeStamp()); break; } } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } }
private void label2_DragDrop(object sender, DragEventArgs e) { this.Activate(); string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false); ArrayList csspaths = new ArrayList(); foreach (string csslj in s) { if (Path.GetExtension(csslj) == ".css" || Path.GetExtension(csslj) == ".txt") { csspaths.Add(csslj); } } if (csspaths.Count != 0) { int j = 0; foreach (string item in csspaths) { j++; Inc.Base64ToImg(item, j.ToString()); } MessageBox.Show("转换完成!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }