最新发布
2023-05-27 17:10
17
/// summary /// 下载 302跳转文件 /// /summary /// param name="parentUrl"父Url/param /// param name="url"302跟转的Url/param /// returns/returns public bool DownFile(string parentUrl,string url) { using (HttpClient client = new …
2023-05-15 11:42
108
//C# goto语句用法,跳转到某个执行步骤public void Test(){ //步骤1 B1: Console.WriteLine("执行步骤1功能"); //步骤3 B2: Console.WriteLine("执行步骤2功能"); //步骤3 B3: Console.WriteLine("执行步骤3功能"); //假如 执行此步…
2023-05-14 17:46
60
读取path1=D:/1.txtfile1=open(path1,r,encoding="utf-8")content1=file1.read()#content2=file1.readlines() #读取所有行#content3=file1.readline() #读取所一行print(content1)file1.close()写入path2=rD:/1.txtfile2=open(path2,a,encoding="utf-8")file2.write…
2023-05-07 22:14
52
s=abcdprint(-.join(s))#输出结果 a-b-c-dls=[1,2,3,4]print(-.join(ls))#输出结果 1-2-3-4本文出自 www.luofenming.com
2023-05-07 21:01
89
s = "123--23--34--3434-444------2";ss=s.split(-)print(ss)#输出结果 [123, , 23, , 34, , 3434, 444, , , , , , 2]tempList=[]for ts in ss: if(ts!=): tempList.append(ts)print(tempList)#输出结果 [123, 23, 34, 3434, 444, 2]#获取前面两个 以‘-’…
2023-05-04 15:04
84
#如果电脑上没有安装mssql模块,则要安装mssql模块 安装模块的执行命令为 pip install pymssqlimport pymssqldef ExecuteNonQuery(sqlStr,paras): try: connect = pymssql.connect(server=192.168.1.23:1433, user=sa, password=123456,database=testdb,autocomm…
2023-04-27 16:22
216
1、同一目录下的两个py文件,分别为A.py和B.pyB.py里面的代码def Add(x,y): return x+y;def SayHello(name): print(fhello {name})A.py 文件调用B.py里面的方法#引用B文件import B#调用B文件里面的Add方法result= B.Add(5,6)print(result)#调用B文件里面的SayHell…
2023-04-27 14:59
269
1、创建C#的dll库。dll名称为MyCsharpDLL.dll,下面是dll里面的代码using System;namespace MyCsharpDLL{ public class Test { public void Print() { Console.WriteLine("Hello world!!!"); } public void Print(string…
2023-04-27 11:15
228
1、报文结构通信模式是主/从方式,也即主请求、从应答的方式。无论主请求报文,还是从应答报文其结构都是如下图这样的2、地址(Address)域信息帧地址域(信息地址)在帧的开始部分,由8位组成,有效的从机设备地址范围0-247(十进制),各从机设备的寻址范围为1-247。主机把从机地…
2023-04-24 09:18
276
public class CRC16Helper{ /// summary /// CRC校验,参数data为byte数组 /// /summary /// param name="data"校验数据,字节数组/param /// returns字节0是高8位,字节1是低8位/returns public static byte[] CRC16(byte[] data) …