仅提供中文版本
Title : 获得电脑特殊文件夹的办法
官方连接:Environment.SpecialFolder
我们通常会在文件中加载一些缓存文件,方便下次运行的时候调取。如果使用硬盘地址如:H:\preview ,用户可能会出现没有H盘符的情况,但是所有的电脑都会有一些固定的缓存路径.
如果想要访问Temp文件夹,在电脑中我们可以输入%temp%命令快速进入,在程序中我们通过Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)调取,参数为枚举值,可以参照官方链接获得具体的地址。

Author: Broccoli
Copyright Notice: All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Related Articles
2020-05-25
How to Compare Version Numbers in C#
Reference Article: C# How to compare version numbersIn C#, there is a Version class that can be used to compare version numbers.

2020-05-27
C# Software Auto-update via Database
Idea I read many blogs using local and server XML documents for updates, so I wondered if this could be done using a database.The basic idea is consistent with the general way. There will be a local XML file recording version number, update time, and local software address info. xml1234567891011<?xml version="1.0" encoding="utf-8" ?><AutoUpDater> <URLAdres url =""/> <UpdateInfo> <UpdateTime Date="2020-05-20"/> <...

2020-12-03
c# 字符串与16进制互导
参考链接:c#实现16进制和字符串之间转换的代码C#字符串与16进制的相互转换结果:code: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApp{ class Program { static void Main(string[] args) { string path = @"F:\mrm\publicShare\thumbnails"; var directory = Directory.GetFiles...
2020-06-19
C# wpf 智能选择对话框
参考链接:WPF-15:AutoCompleteBox的使用(实现下拉列表)WPF: AutoCompleteBox, an autocomplete text box如果出现未能加载程序集,可以参照这篇回答 准备:WpfToolKit.dll,System.Windows.Controls.Input.Toolkit.dll下载或通过nuget搜索安装,下载链接在第一个博客中 内容:前端通过wpftool框架实现自动补全信息或智能选择的功能在前端添加xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"在窗口内实现AutoCompleteBox 1234567891011<toolkit:AutoCompleteBox x:Name="searchTextBox" Grid.Row="1" ValueMemberPath="SerchString" ...

2021-10-13
C# Writing Data to Word via Template
Project interface created based on reference download link: Method to automatically create Word document via template in C#, but the resource is a txt file, need to type the code manually, considered as practice.Before starting, we need to install Microsoft.Office.Interop.Word from NuGet. Below is the code needed, just copy it directly. It is slightly different from using NPOI. 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626...
2020-01-19
Issue where modifying List A also modifies List B
Reference ArticleToday, while programming, I performed list conversion and simultaneously deleted items from the converted list. 12List<XYZ> A = firList; A.RemoveAt(0); I found that after deleting from A, the firList was also deleted.The specific reason hasn’t been investigated clearly yet. I assume it’s because of memory usage, causing both lists to operate simultaneously. The exact reason is not verified, leaving a note to update later. 123List<XYZ> newFirList = n...
Announcement
欢迎访问!右上角可切换中英文。感谢您的阅读!

