- 博客(15)
- 资源 (5)
- 收藏
- 关注
原创 Delphi 对Txt文件的操作
{将文件名与变量 F 关联}ReWrite(F);{把内容 Ser 写入文件F }F : Textfile;{定义 F 为 Textfile}Readln(F, Str);{读取内容并赋值给 Str}Append(F);{附上原来的内容以免原内容被清空}while not EOF(F) do {循环读取}Closefile(F);{逐行读取,顾名思义一行一行的读取内容}{先附上原内容在写入新内容}{读取指定的TXT文档}
2023-04-11 14:02:05
687
原创 C# Invoke 用法
控件名称.Invoke(new EventHandler(delegate{button1.Text = "我是一个测试按钮";this.Invoke(new EventHandler(delegate{button1.Text = "我是一个测试按钮";this.Invoke(new Action(() =>{ button1.Text = "我是一个测试按钮";this.button1.Text = "我是一个测试按钮";this.lbl_Value.Text = "我还是一个测试按钮";
2021-11-17 09:20:01
978
原创 C# ini文件读写操纵
public partial class Form1 : Form { [DllImport("kernel32")] private static extern long WritePrivateProfileString(string section, string key, string val, string filePath); [DllImport("kernel32")] private static extern i.
2021-11-04 16:46:40
141
原创 c# excel 导入
private void btnimport_Click(object sender, EventArgs e) { string filePath = Application.StartupPath + "\\test.xls"; string sqlconn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properti.
2021-11-02 21:31:35
230
原创 C# winform socket 通讯
服务端服务端代码 Socket client_socket; Socket serversocket; Socket testsocket; private Thread thread; private Thread th_c; delegate void SetTextCallBack(string text); public FrmMain() { .
2021-11-02 14:58:10
979
原创 C#sqlserver DbHelper类
配置文件<connectionStrings> <add name="dh_web" connectionString="Data Source=xxx.com;Initial Catalog=xx_db;User ID=xx;Password=**; pooling=true;max pool size=200" providerName="System.Data.SqlClient"/></connectionStrings>DbHelp
2021-09-14 08:52:20
322
原创 C#上位机编程常用方法
单个byte转16进制字符串byte _byte = 97;string result= Convert.ToString(_byte, 16);// result="61"byte[]转16进制字符串/// <summary>/// 字节数组转16进制字符串:空格分隔/// </summary>/// <param name="byteDatas"></param>/// <returns></returns>p
2021-07-28 08:49:45
719
原创 dbgrid添加复选框实现多选功能
最近开发的DELPHI项目中,遇到这样的一个常见的需求,DBgrid实现多选功能。这个功能第三方控件其实可以直接拿来用,现在我们在不使用三方控件的情况看看如何实现
2021-06-07 09:00:55
1986
原创 delphi 不同程序之间的消息传递
项目中遇到不同进程之间的字符串传递,用到TCopyDataStruct结构:发送端:procedure TForm1.Button2Click(Sender: TObject);varh: HWND;Size: Integer;CopyDataStruct: TCopyDataStruct;begin h := FindWindow(nil, 'Formzztool'); { 按标题查找目标窗口 } if h > 0 then begin Size...
2021-03-12 12:55:41
606
转载 minSDKVersion、targetSDKVersion和compileSDKVersion
minSDKVersion顾名思义是设置sdk最低版本的。作用就是操作系统会拒绝低于该标准的APP的安装。例如,minSDKVersion设置为16(Jelly Bean 4.1系统),那么该APP将只能运行在4.1系统以上的设备中,想要在2.3系统上安装是不被允许的。minSDKVersion比较容易理解,经常让我混淆的时其他两个版本设置会对API产生的影响。targetSDK...
2020-03-20 10:43:23
299
转载 c#中delegrate委托的使用
开发过程中,遇到了串口接收数据,socket接受数据,线程过程的数据需要显示到页面的时候,如果直接赋值,会报错。这个时候需要用到委托,由主线程来操作界面的控件。例子1//测试的窗体 2 public class TestForm : Form 3 { 4 //创建一个Button对象 5 private Button button = new Button(...
2020-03-19 16:23:21
783
1
原创 C#操作字符串方法总结
C#操作字符串方法总结staticvoidMain(string[] args){strings="";//(1)字符访问(下标访问s[i]) s="ABCD"; Console.WriteLine(s[0]);//输出"A"; Console.WriteL...
2020-03-11 10:27:18
156
原创 C# 调用C++编写的dll,dll中有个输出参数是pwchar的类型
C# 调用C++编写的dll,dll中有个输出参数是pwchar的类型,定义如下 [DllImport("cxxxx.dll", EntryPoint = "IniSetxxxx", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)] public static e...
2020-03-11 10:02:02
270
原创 delphi 常用方法
1、文件查找的方法方法1、function Searchfile(path: string): TStringList;var SearchRec: TSearchRec; found: integer;begin Result := TStringList.Create; found := FindFirst(path + '\' + '*.*', faAnyFile...
2020-02-26 11:07:45
1231
转载 Android 实现复制黏贴
EditText的长按事件会自动弹出上下文菜单,其中有“选择文字”“复制”“粘贴”等功能选项,想让TextView也具有这样的功能,经研究,EditText就是继承于TextView而来的,在TextView的源码中就存在“选择文字”“复制”“粘贴”等功能的代码,(但是为什么在布局中添加组件却不能直接使用这些功能呢,尚有待研究),我发现一种简单方法可以使EditText“变成”具有“选择文字”“复
2014-11-27 15:30:27
410
delphi 最小化到托盘控件CoolTrayIcon
2022-05-16
delphi 如何利用image 画布来制作签名
2022-04-20
Delphi连接数据库控件支持多种常见数据库 zeosdbo-7.2.4-stable.rar
2021-09-16
自定义鼠标指针扩大缩小左右转cur图
2020-08-13
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人