随笔分类 - C#后台
C#使用中遇到的一些问题
摘要:var path = HttpContext.Server.MapPath($"~/Temp/文件xls导出{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xls"); 获取datatable数据... try { Workbook newBook1 = n
阅读全文
摘要:using System.ServiceProcess; string serviceName = "WeChat"; string processName = "WeChat"; private void Test1() { List<string> ls = new List<string>()
阅读全文
摘要:发送端: using System.Runtime.InteropServices; //DllImport /*发送消息的结构体*/ [DllImport("User32.dll", EntryPoint = "SendMessage")] private static extern int Se
阅读全文
摘要:using System.Windows.Interop;using System.Runtime.InteropServices; //DllImport /*通过这个方法,可以找到主进程的窗体*/ [DllImport("User32.dll", EntryPoint = "FindWindow
阅读全文
摘要:using System.Windows.Interop; this.SourceInitialized += new EventHandler(MainWindow_SourceInitialized); protected override void OnSourceInitialized(Ev
阅读全文
摘要:JObject jo = (JObject)JsonConvert.DeserializeObject(sent); List<string> ls = new List<string>(); foreach(var item in jo) { ls.Add(item.Key); }
阅读全文
摘要:@Styles.Render("") @Scripts.Render("")
阅读全文
摘要:class Api { /// <summary> /// 从API中获取数据 /// </summary> /// <param name="url"></param> /// <returns></returns> public static string HttpGet(string url)
阅读全文
摘要:C#后台导出纯文本文件,解决SQL文件利用js导出时打开乱码。需要换行直接在字符串中换行就可以了。 string str = $@" aaaa bbbb"; byte[] Buff2 = System.Text.Encoding.Default.GetBytes(str); return File(
阅读全文
摘要:必须为继承Controller的类: Layui接口返回字符串数据:res JObject jr = (JObject)JsonConvert.DeserializeObject(res); JArray data = (JArray)JsonConvert.DeserializeObject(jr
阅读全文

浙公网安备 33010602011771号