C# WPF 读写CAN数据

C# WPF 读写CAN数据

CAN 分析仪

在这里插入图片描述

分析仪资料下载

官方地址:https://www.zhcxgd.com/1.html

CSDN:

项目配置

复制Dll库文件

文件在上面的资料里面

在这里插入图片描述

设置不安全代码

在这里插入图片描述

CAN C#工具类

CAN_Tool.cs

using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;namespace CAN_TEST.tool
{/*------------兼容ZLG的数据类型---------------------------------*///1.ZLGCAN系列接口卡信息的数据类型。//public struct VCI_BOARD_INFO //{ //    public UInt16 hw_Version;//    public UInt16 fw_Version;//    public UInt16 dr_Version;//    public UInt16 in_Version;//    public UInt16 irq_Num;//    public byte   can_Num;//    [MarshalAs(UnmanagedType.ByValArray, SizeConst=20)] public byte []str_Serial_Num;//    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)]//    public byte[] str_hw_Type;//    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]//    public byte[] Reserved;//}//以下为简易定义与调用方式,在项目属性->生成->勾选使用不安全代码即可unsafe public struct VCI_BOARD_INFO//使用不安全代码{public UInt16 hw_Version;public UInt16 fw_Version;public UInt16 dr_Version;public UInt16 in_Version;public UInt16 irq_Num;public byte can_Num;public fixed byte str_Serial_Num[20];public fixed byte str_hw_Type[40];public fixed byte Reserved[8];}///2.定义CAN信息帧的数据类型。unsafe public struct VCI_CAN_OBJ  //使用不安全代码{public uint ID;public uint TimeStamp;        //时间标识public byte TimeFlag;         //是否使用时间标识public byte SendType;         //发送标志。保留,未用public byte RemoteFlag;       //是否是远程帧public byte ExternFlag;       //是否是扩展帧public byte DataLen;          //数据长度public fixed byte Data[8];    //数据public fixed byte Reserved[3];//保留位}//3.定义初始化CAN的数据类型public struct VCI_INIT_CONFIG{public UInt32 AccCode;public UInt32 AccMask;public UInt32 Reserved;public byte Filter;   //0或1接收所有帧。2标准帧滤波,3是扩展帧滤波。public byte Timing0;  //波特率参数,具体配置,请查看二次开发库函数说明书。public byte Timing1;public byte Mode;     //模式,0表示正常模式,1表示只听模式,2自测模式}/*------------其他数据结构描述---------------------------------*///4.USB-CAN总线适配器板卡信息的数据类型1,该类型为VCI_FindUsbDevice函数的返回参数。public struct VCI_BOARD_INFO1{public UInt16 hw_Version;public UInt16 fw_Version;public UInt16 dr_Version;public UInt16 in_Version;public UInt16 irq_Num;public byte can_Num;public byte Reserved;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public byte[] str_Serial_Num;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]public byte[] str_hw_Type;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]public byte[] str_Usb_Serial;}/*------------数据结构描述完成---------------------------------*/public struct CHGDESIPANDPORT{[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]public byte[] szpwd;[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]public byte[] szdesip;public Int32 desport;public void Init(){szpwd = new byte[10];szdesip = new byte[20];}}public class CAN_Tool{const int DEV_USBCAN = 3;const int DEV_USBCAN2 = 4;/// <summary>/// /// </summary>/// <param name="DeviceType"></param>/// <param name="DeviceInd"></param>/// <param name="Reserved"></param>/// <returns></returns>/*------------兼容ZLG的函数描述---------------------------------*//*------------兼容ZLG的函数描述---------------------------------*/[DllImport("controlcan.dll")]public static extern UInt32 VCI_OpenDevice(UInt32 DeviceType, UInt32 DeviceInd, UInt32 Reserved);[DllImport("controlcan.dll")]public static extern UInt32 VCI_CloseDevice(UInt32 DeviceType, UInt32 DeviceInd);[DllImport("controlcan.dll")]public static extern UInt32 VCI_InitCAN(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd, ref VCI_INIT_CONFIG pInitConfig);[DllImport("controlcan.dll")]public static extern UInt32 VCI_ReadBoardInfo(UInt32 DeviceType, UInt32 DeviceInd, ref VCI_BOARD_INFO pInfo);[DllImport("controlcan.dll")]public static extern UInt32 VCI_GetReceiveNum(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd);[DllImport("controlcan.dll")]public static extern UInt32 VCI_ClearBuffer(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd);[DllImport("controlcan.dll")]public static extern UInt32 VCI_StartCAN(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd);[DllImport("controlcan.dll")]public static extern UInt32 VCI_ResetCAN(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd);[DllImport("controlcan.dll")]public static extern UInt32 VCI_Transmit(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd, ref VCI_CAN_OBJ pSend, UInt32 Len);[DllImport("controlcan.dll")]public static extern UInt32 VCI_Receive(UInt32 DeviceType, UInt32 DeviceInd, UInt32 CANInd, ref VCI_CAN_OBJ pReceive, UInt32 Len, Int32 WaitTime);/*------------其他函数描述---------------------------------*/[DllImport("controlcan.dll")]public static extern UInt32 VCI_ConnectDevice(UInt32 DevType, UInt32 DevIndex);[DllImport("controlcan.dll")]public static extern UInt32 VCI_UsbDeviceReset(UInt32 DevType, UInt32 DevIndex, UInt32 Reserved);[DllImport("controlcan.dll")]public static extern UInt32 VCI_FindUsbDevice2(ref VCI_BOARD_INFO pInfo);/*------------函数描述结束---------------------------------*/static UInt32 m_bOpen = 0;static UInt32 m_devind = 0;static UInt32 m_canind = 0;static UInt32[] m_arrdevtype = new UInt32[20];static VCI_CAN_OBJ[] m_recobj = new VCI_CAN_OBJ[1000];static UInt32 m_devtype = 4;//USBCAN2//this.timer_rec = new System.Windows.Forms.Timer(this.components);public static void init(){m_arrdevtype[2] = 3;m_arrdevtype[3] = 4;}public static void close_CAN(){CAN_Tool.VCI_CloseDevice(m_devtype, m_devind);m_bOpen = 0;}public static void start_CAN(){if (m_bOpen == 0)return;CAN_Tool.VCI_StartCAN(m_devtype, m_devind, m_canind);}unsafe public static string can_send(string can_data_idText,string can_send_data){if (m_bOpen == 0){MessageBox.Show("CAN断开连接", "错误");return null;}VCI_CAN_OBJ sendobj = new VCI_CAN_OBJ();//sendobj.Init();sendobj.RemoteFlag = (byte)0;sendobj.ExternFlag = (byte)0;sendobj.ID = System.Convert.ToUInt32("0x" + can_data_idText, 16);int len = (can_send_data.Length + 1) / 3;sendobj.DataLen = System.Convert.ToByte(len);String strdata = can_send_data;//MessageBox.Show(strdata);int i = -1;if (i++ < len - 1)sendobj.Data[0] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[1] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[2] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[3] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[4] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[5] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[6] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (i++ < len - 1)sendobj.Data[7] = System.Convert.ToByte("0x" + strdata.Substring(i * 3, 2), 16);if (CAN_Tool.VCI_Transmit(m_devtype, m_devind, m_canind, ref sendobj, 1) == 0){MessageBox.Show("发送失败", "错误");return null;}else{return "TX   帧ID:" + can_data_idText + " 数据:  " + can_send_data;}}public static string connect_CAN(int CAN_Type, int CAN_id,int RUN_mod){//以下两行为多卡同机测试代码,用来获取序列号与对应的设备索引号,单卡可以不使用。VCI_BOARD_INFO[] vbi2 = new VCI_BOARD_INFO[50];uint num1 = CAN_Tool.VCI_FindUsbDevice2(ref vbi2[0]);m_devtype = m_arrdevtype[CAN_Type + 2];m_devind = 0;m_canind = (UInt32)CAN_id;if (CAN_Tool.VCI_OpenDevice(m_devtype, m_devind, 0) == 0){MessageBox.Show("打开设备失败,请检查设备类型和设备索引号是否正确", "错误");m_bOpen = 0;return "";}m_bOpen = 1;VCI_INIT_CONFIG config = new VCI_INIT_CONFIG();config.AccCode = System.Convert.ToUInt32("0x" + "00000000", 16);config.AccMask = System.Convert.ToUInt32("0x" + "FFFFFFFF", 16);config.Timing0 = System.Convert.ToByte("0x" + "00", 16);config.Timing1 = System.Convert.ToByte("0x" + "1C", 16);config.Filter = (Byte)(0 + 1);config.Mode = (Byte)RUN_mod;CAN_Tool.VCI_InitCAN(m_devtype, m_devind, m_canind, ref config);return m_bOpen == 0 ? "断开" : "连接";}unsafe public static string TimerRecTick(){UInt32 res = new UInt32();res = CAN_Tool.VCI_Receive(m_devtype, m_devind, m_canind, ref m_recobj[0], 1000, 100);///IntPtr[] ptArray = new IntPtr[1];//ptArray[0] = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(VCI_CAN_OBJ)) * 50);//IntPtr pt = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)) * 1);//Marshal.Copy(ptArray, 0, pt, 1);//MessageBox.Show(res+"");//res = VCI_Receive(m_devtype, m_devind, m_canind, pt, 50/*50*/, 100);if (res == 0xFFFFFFFF) res = 0;//当设备未初始化时,返回0xFFFFFFFF,不进行列表显示。String str = "";for (UInt32 i = 0; i < res; i++){//VCI_CAN_OBJ obj = (VCI_CAN_OBJ)Marshal.PtrToStructure((IntPtr)((UInt32)pt + i * Marshal.SizeOf(typeof(VCI_CAN_OBJ))), typeof(VCI_CAN_OBJ));str = "RX: ";str += "  帧ID:0x" + System.Convert.ToString(m_recobj[i].ID, 16);str += "  帧格式:";if (m_recobj[i].RemoteFlag == 0)str += "数据帧 ";elsestr += "远程帧 ";if (m_recobj[i].ExternFlag == 0)str += "标准帧 ";elsestr += "扩展帧 ";//if (m_recobj[i].RemoteFlag == 0){str += "数据: ";byte len = (byte)(m_recobj[i].DataLen % 9);byte j = 0;fixed (VCI_CAN_OBJ* m_recobj1 = &m_recobj[i]){if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[0], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[1], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[2], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[3], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[4], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[5], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[6], 16);if (j++ < len)str += " " + System.Convert.ToString(m_recobj1->Data[7], 16);}}return str + "\n";}return null;}}
}

主界面

在这里插入图片描述

MainWindow.xaml

<Window x:Class="CAN_TEST.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"mc:Ignorable="d"Title="CAN测试" Height="600" Width="400"><Grid><StackPanel><StackPanel Orientation="Horizontal" Height="30" Margin="0,20,0,0"><Button Margin="10,0,0,0" Click="connect_CAN" Width="100">连接分析仪</Button><Button Margin="20,0,0,0" Click="close_CAN"  Width="100">断开分析仪</Button><Button Margin="20,0,0,0" Click="start_CAN"  Width="100">启动CAN</Button></StackPanel><StackPanel Orientation="Horizontal" Height="30" Margin="0,20,0,0"><StackPanel Orientation="Horizontal" Margin="20,0,0,0"><TextBlock>CAN类型</TextBlock><ComboBox HorizontalAlignment="Center" Width="100" Margin="20,0,0,0" x:Name="CAN_Type"><ComboBoxItem>USBCAN V1</ComboBoxItem><ComboBoxItem>USBCAN V2</ComboBoxItem></ComboBox></StackPanel><StackPanel Orientation="Horizontal" Margin="20,0,0,0"><TextBlock>CAN通道</TextBlock><ComboBox HorizontalAlignment="Center" Width="100" Margin="20,0,0,0"  x:Name="CAN_id"><ComboBoxItem>CAN1</ComboBoxItem><ComboBoxItem>CAN2</ComboBoxItem></ComboBox></StackPanel></StackPanel><StackPanel Orientation="Horizontal" Height="30" Margin="0,20,0,0"><StackPanel Orientation="Horizontal" Margin="20,0,0,0"><TextBlock>CAN运行模式</TextBlock><ComboBox HorizontalAlignment="Center" Width="100" Margin="20,0,0,0"  x:Name="RUN_mod"><ComboBoxItem>正常</ComboBoxItem><ComboBoxItem>只听</ComboBoxItem><ComboBoxItem>自测</ComboBoxItem></ComboBox></StackPanel><TextBlock Margin="20,0,0,0">连接状态:</TextBlock><TextBlock Text="断开" x:Name="CAN_statusText"></TextBlock></StackPanel><StackPanel Orientation="Horizontal"><StackPanel Orientation="Vertical"  Width="300"  Margin="0,10,0,0"><TextBlock TextAlignment="Center">数据发送</TextBlock><StackPanel Orientation="Horizontal" Margin="0,10,0,0"><TextBlock  TextAlignment="Center" Margin="20,0,0,0">帧ID:</TextBlock><TextBox Width="200" Margin="33,0,0,0"  x:Name="can_data_id" Text="00000123"></TextBox></StackPanel><StackPanel Orientation="Horizontal" Margin="0,10,0,0"><TextBlock  TextAlignment="Center" Margin="20,0,0,0">发送数据:</TextBlock><TextBox Width="200" Margin="10,0,0,0"  x:Name="can_send_data" Text="00 01 02 03 04 05 06 07 "></TextBox></StackPanel><Button Width="50"  Margin="0,10,0,0" Click="can_send">发送</Button></StackPanel></StackPanel><StackPanel Orientation="Horizontal"><TextBlock TextAlignment="Center">数据接收</TextBlock></StackPanel><StackPanel Orientation="Horizontal"><TextBox Width="350" Height="200" Margin="10,0,0,0" VerticalScrollBarVisibility="Visible" MaxLines="5" x:Name="resData" TextWrapping="Wrap"></TextBox></StackPanel></StackPanel></Grid>
</Window>

MainWindow.xaml.cs

using CAN_TEST.tool;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Text;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using static CAN_TEST.MainWindow;namespace HZFM_TEST
{/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>public partial class MainWindow : Window{DispatcherTimer m_timer = new DispatcherTimer();public MainWindow(){InitializeComponent();// 初始化CANCAN_Tool.init();// 启动定时器m_timer.Interval = TimeSpan.FromSeconds(0.2);m_timer.Tick += new System.EventHandler(timer_rec_Tick);}private void close_CAN(object sender, RoutedEventArgs e){// 关闭CANCAN_Tool.close_CAN();}private void start_CAN(object sender, RoutedEventArgs e){// 启动CANCAN_Tool.start_CAN();}private void connect_CAN(object sender, RoutedEventArgs e){	// 连接CAN分析仪string outData = CAN_Tool.connect_CAN(CAN_Type.SelectedIndex,  CAN_id.SelectedIndex, RUN_mod.SelectedIndex);if(outData.Length > 0){m_timer.Start();}CAN_statusText.Text = outData;}// 定时收数据任务unsafe private void timer_rec_Tick(object sender, EventArgs e){string res = CAN_Tool.TimerRecTick();if(res != null){resData.AppendText(res + "\r\n");}}// 发送惨数据unsafe private void can_send(object sender, RoutedEventArgs e){string res = CAN_Tool.can_send(can_data_id.Text, can_send_data.Text);if (res != null){resData.AppendText(res + "\r\n");}}// 读取数据private void read_Data(object sender, RoutedEventArgs e){Button btn = sender as Button;int id = int.Parse(btn.CommandParameter.ToString()) + 1;string res = CAN_Tool.can_send("01800300", can_send_data.Text);if (res != null){resData.AppendText(res + "\r\n");}}}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/26415.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MySQL 触发器(实验报告)

一、实验名称&#xff1a; 触发器 二、实验日期&#xff1a; 2024 年 6月 8日 三、实验目的&#xff1a; 掌握MySQL触发器的创建及调用&#xff1b; 四、实验用的仪器和材料&#xff1a; 硬件&#xff1a;PC电脑一台&#xff1b; 配置&#xff1a;内存&#xff0c;…

学习笔记丨嵌入式BI分析的12个关键功能

编者注&#xff1a;以下内容节选编译自嵌入式分析厂商Qrvey发表的《What is Embedded Analytics?》&#xff08;什么是嵌入式分析&#xff09;一文&#xff0c;作者为Qrvey产品市场主管Brian Dreyer。 什么是嵌入式分析&#xff1f; 嵌入式分析是指能够将数据分析的特性和功…

用ChatGPT 4o画漂亮的燃尽图代码

把代码给ChatGPT&#xff0c;然后他就会帮我生成出来了。 而且图是动态的&#xff0c;可以调整颜色文字之类的内容 # Given data for Sprint 5 Progress data_sprint_5 {User Story: [BEAN-40, BEAN-42, BEAN-41, BEAN-22, BEAN-33, BEAN-44, BEAN-10, BEAN-26, BEAN-37, BEA…

【SQL边干边学系列】07高级问题-3

文章目录 前言回顾高级问题41.逾期订单42.逾期订单-哪些员工&#xff1f;43.逾期订单与总订单相比44.逾期订单与总订单相比 - 丢失的员工45.逾期订单与总订单相比 - 修复null46.逾期订单与总订单之间的百分比47.逾期订单与总订单相比 - 修正decimal 答案41.逾期订单42.逾期订单…

Linux - 复盘一次句柄数引发的故障

文章目录 Pre&#xff08;内核、用户、进程&#xff09;句柄数设置问题 shell修复 Pre Linux - 深入理解/proc虚拟文件系统&#xff1a;从基础到高级 &#xff08;内核、用户、进程&#xff09;句柄数设置 在Linux系统中&#xff0c;进程打开的最大句柄数可以通过多种方式配置…

第二证券:大牛股连续七跌停,上市公司坐不住了!机构抄底

6月12日&#xff0c;沪深股市双双飘红。但是&#xff0c;从前的大牛股松炀资源(603863)&#xff0c;却依然跌停收盘。这也是公司股价近日来的接连第七个跌停板。 龙虎榜显现&#xff0c;6月12日&#xff0c;松炀资源全天换手率10.38%&#xff0c;成交额3.45亿元。当天&#xf…

沉降观测点的定义、重要性、建设与选择

沉降观测点&#xff0c;简称沉降点&#xff0c;是指在建筑物、构筑物或地基等结构物上设置的用于测量其垂直位移(沉降)的特定位置。这些点通常被标记并安装相应的监测设备&#xff0c;以便长期、连续地监测结构物的沉降情况。 点击输入图片描述&#xff08;最多30字&#xff09…

python接入汇率换算工具提高网站/小程序日活度

实时汇率换算工具可以帮助用户快速准确地计算不同货币之间最新的汇兑比例。无论是金融从业者或者是人们日常生活出行都会使用到&#xff0c;广泛用于国际结算、银行汇率查询应用、开展跨国贸易、投资等参考场景。 我们可以通过在网站或者小程序中接入这样一个小工具&#xff0…

【Ardiuno】实验ESP32单片机自动配置Wifi功能(图文)

这里小飞鱼按照ESP32的示例代码&#xff0c;实验一下wifi的自动配置功能。所谓的自动配置&#xff0c;就是不用提前将wifi的名称和密码写到程序里&#xff0c;这样可以保证程序在烧录上传后&#xff0c;可以通过手机端的软件来进行配置&#xff0c;可以避免反复修改代码&#x…

ChromeOS 逐渐靠近安卓

ChromeOS 逐渐 “安卓化” 谷歌在博客中透露&#xff0c;将在ChromeOS底层更广泛地使用和Android相同的技术栈。一个具体的例子是&#xff0c;ChromeOS现在已经开始使用Android的蓝牙协议栈&#xff0c;取代了之前使用的自己的协议栈。这次改变不仅提高了蓝牙配对速度&#xf…

Postman下发流表至Opendaylight

目录 任务目的 任务内容 实验原理 实验环境 实验过程 1、打开ODL控制器 2、网页端打开ODL控制页面 3、创建拓扑 4、Postman中查看交换机的信息 5、L2层流表下发 6、L3层流表下发 7、L4层流表下发 任务目的 1、掌握OpenFlow流表相关知识&#xff0c;理解SDN网络中L…

【vue-8】记事本案例

小知识点&#xff1a; 列表末尾插入数据&#xff1a; list.push("lihua") 列表删除数据&#xff1a; # index要删除数据的索引值&#xff0c;1为删除数据长度 list.splice(index,1) 完整示例代码&#xff1a; <!DOCTYPE html> <html lang"en&quo…

R语言ggHoriPlot包绘制地平线图

数据和代码获取&#xff1a;请查看主页个人信息&#xff01;&#xff01;&#xff01; 关键词“地平线图” 1. 数据读取与处理 首先&#xff0c;从TSV文件中读取数据&#xff0c;并进行数据清洗和处理。 rm(listls()) pacman::p_load(tidyverse,ggalt,ggHoriPlot,hrbrthemes…

教程:A5000 GPU 上运行阿里最新开源大模型 Qwen2

这是我们新一篇关于大模型的文章&#xff0c;我们此前还讲过如何运行 LLama3 大模型。而这次&#xff0c;我们将使用 Ollama 运行阿里千问Qwen2:7b。要知道 Qwen2 可是目前最热门的开源大语言模型了&#xff0c;甚至在一些性能测试中比 LLama3 表现还突出。谁不想试试看呢&…

C#下WinForm多语种切换

这是应一个网友要求写的&#xff0c;希望对你有所帮助。本文将介绍如何在一个WinForm应用程序中实现多语种切换。通过一个简单的示例&#xff0c;你将了解到如何使用资源文件管理不同语言的文本&#xff0c;并通过用户界面实现语言切换。 创建WinForm项目 打开Visual Studio&a…

最新下载:XmanagerXShell【软件附加安装教程】

​XManager企业版是一款完整的企业网络连接套件&#xff0c;它配备了一个高性能的PC服务器&#xff0c;安全终端模拟器&#xff0c;是一个一体化的解决方案&#xff0c;将xmanager&#xff0c;xshell&#xff0c;xftp&#xff0c;xlpd&#xff0c;Xbrowser及xstart放置在一个软…

C#发送邮件

C#发送邮件代码&#xff0c;亲测可用。 using System; using System.Net; using System.Net.Mail;namespace MailSend {class Program{static void Main(string[] args){try{MailAddress receiver new MailAddress("666666666qq.com");//666666666qq.com 换成收件人…

从零开始手把手Vue3+TypeScript+ElementPlus管理后台项目实战十(整体布局03之界面美化)

删除style.css 删除style.css(和main.ts同级) 并且注释掉main.ts中对style.css的导入。 修改App.vue 添加样式设置高度100% 安装sass pnpm install -D sass修改PageSidebar.vue 修改index.vue 修改src/layout/index.vue src/layout/index.vue添加样式 <style lang&quo…

09_探索时间序列的秘密:重新理解LSTM网络

1.1 简介 LSTM&#xff0c;全称为长短期记忆网络&#xff08;Long Short-Term Memory&#xff09;&#xff0c;是一种特殊的循环神经网络&#xff08;RNN&#xff09;结构&#xff0c;由Sepp Hochreiter和Jrgen Schmidhuber在1997年提出。它的设计初衷是为了克服传统RNN在处理…

tmega128单片机控制的智能小车设计

第1章 绪论1.1 选题背景和意义 自第一台工业机器人诞生以来,机器人的民展已经遍及机械、电子、冶金、交通、宇航、国防等领域。近年来机器人的智能水平不断提高,并且迅速地改变着人们的生活方式。人们在不断探讨、改造、认识自然的过程中,制造能替代人工作的机器一…