-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
261 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
title: 精选软件 | ||
date: 2024-01-10 10:31:35 | ||
permalink: /pages/41d852/ | ||
article: false | ||
author: | ||
name: Kronos | ||
link: https://github.com/jywangyou | ||
--- | ||
|
||
## 编辑器 | ||
- [VS Code](https://code.visualstudio.com/) 最好用的编程软件 | ||
- [HBuilderX](https://www.dcloud.io/hbuilderx.html) 国内优秀编辑器 | ||
- [微信开发者工具](https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 微信小程序开发首选 | ||
- [Visual Studio](https://visualstudio.microsoft.com/zh-hans/downloads/) 地表最强编辑器 | ||
- [IntelliJ IDEA](https://www.jetbrains.com/zh-cn/idea/download/?section=windows) 领先的 Java 和 Kotlin IDE | ||
|
||
## 开发工具 | ||
- [Node.js](https://nodejs.org/en/) | ||
- [Git](https://git-scm.com/) | ||
|
||
## 通讯 | ||
- [QQ](https://im.qq.com/index/) | ||
- [微信](https://weixin.qq.com/) | ||
|
||
## 浏览器 | ||
- [Chrome](https://www.google.cn/intl/zh-CN/chrome/) 谷歌浏览器 | ||
- [Firefox](https://www.firefox.com.cn/) 火狐浏览器 | ||
- [Opera](https://www.opera.com/zh-cn/download) 欧朋浏览器 | ||
|
||
## 压缩 | ||
- [360压缩](https://www.360totalsecurity.com/zh-cn/360zip/) 国际版,无广 | ||
- [7-Zip](https://www.7-zip.org/download.html) 轻量,极致压缩 | ||
- [WinRAR](https://www.win-rar.com/predownload.html?&L=7) 老牌压缩软件 | ||
|
||
|
||
## 屏幕录制 | ||
- [EV录屏](https://www.ieway.cn/evcapture.html) 免费无水印 | ||
- [OBS Studio](https://obsproject.com/) 免费开源,直播-录屏 | ||
- [ScreenToGif](https://www.screentogif.com/) 微软出品,GIF录制首选 | ||
|
||
## 截图贴图 | ||
- [Snipaste](https://zh.snipaste.com/) 免费无广,轻量极简 | ||
- [PixPin](https://pixpinapp.com/) 可截长图,OCR识别 | ||
|
||
## 手机投屏 | ||
- [QtScrcpy](https://gitee.com/Barryda/QtScrcpy/releases) 安卓手机投屏到电脑 | ||
- [scrcpy](https://github.com/Genymobile/scrcpy/releases) 适用于安卓手机 | ||
|
||
|
||
## 虚拟机 | ||
- [VMware](https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html) 支持多种系统运行 | ||
- [BlueStacks](https://www.bluestacks.com/tw/index.html) 安卓模拟器 | ||
|
||
|
||
## 远程控制 | ||
- [向日葵](https://sunlogin.oray.com/) | ||
|
||
|
||
## 翻译 | ||
- [网易有道翻译](https://fanyi.youdao.com/download-Windows#/) | ||
- [腾讯交互翻译](https://transmart.qq.com/zh-CN/download) | ||
- [Pot](https://pot-app.com/) 跨平台划词翻译和OCR | ||
|
||
|
||
## 笔记 | ||
- [Typora](https://typora.io/) 优秀的 Markdown 编辑器 | ||
- [Notepad++](https://notepad-plus-plus.org/downloads/v8.4.7/) | ||
- [有道云笔记](https://note.youdao.com/) 云端同步 | ||
|
||
|
||
## 桌面整理 | ||
- [酷呆桌面](https://www.coodesker.com/) 支持硬件加速,启动很快 | ||
- [腾讯电脑管家桌面整理](https://guanjia.qq.com/product/zmzl/?ADTAG=media.innerenter.gj_product&wd=&eqid=ab60bbea000010a20000000465291abf) 可下载桌面整理独立版 | ||
|
||
|
||
## 网盘 | ||
- [百度网盘](https://pan.baidu.com/download?_at_=1704863197978#win) | ||
- [夸克网盘](https://pan.quark.cn/) | ||
|
||
|
||
## 游戏相关 | ||
- [Steam](https://store.steampowered.com/about) | ||
- [EPIC](https://www.epicgames.com/help/zh-CN/?lang=zh-CN) | ||
- [EA](https://www.ea.com/ea-app?isLocalized=true) | ||
- [原神](https://ys.mihoyo.com/) 启动! | ||
|
||
## 其他 | ||
- [图吧工具箱](https://www.tbtool.cn/#container_23932c22) 硬件检测工具合集 | ||
- [分流抢票](https://www.bypass.cn/) 高铁、火车抢票软件 | ||
- [LIVELY WALLPAPER](https://www.rocksdanister.com/lively/) 动态壁纸 | ||
- [大饼AI](https://dubbingai.io/) ai变声 | ||
- [SoftPerfect Network Scanner v8.1.6](https://pan.baidu.com/s/1GvvlU3NYeC2DhKEeNwANjw?pwd=f1jm) 局域网IP扫描工具 便携版 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: C#将字符串转换为日期 | ||
date: 2024-01-10 09:28:23 | ||
permalink: /pages/05fe96/ | ||
categories: | ||
- C# 笔记 | ||
tags: | ||
- C# | ||
author: | ||
name: Kronos | ||
link: https://github.com/jywangyou | ||
--- | ||
|
||
在C#开发中,经常遇到处理日期和时间的任务。有时候,需要将字符串转换为日期对象,以便在应用程序中进行更进一步的处理。浅浅记录下日期时间处理的方法。 | ||
|
||
## 使用 DateTime.Parse 方法 | ||
|
||
C# 中的 `DateTime.Parse` 方法是将字符串转换为 DateTime 对象的一种常见方法。以下是一个简单的例子: | ||
|
||
```csharp | ||
string dateString = "2024-01-09"; | ||
DateTime date = DateTime.Parse(dateString); | ||
``` | ||
|
||
这段代码将字符串"2024-01-09"转换为 DateTime 对象。需要注意的是,`DateTime.Parse` 方法 **对于标准日期格式通常是有效的,但对于非标准格式可能会引发异常**。 | ||
|
||
## 使用 DateTime.TryParse 方法 | ||
|
||
为了防止由于非法日期字符串而引发异常,可以使用 `DateTime.TryParse` 方法,它会返回一个布尔值,指示转换是否成功: | ||
|
||
```csharp | ||
string dateString = "2024-01-09"; | ||
DateTime date; | ||
if (DateTime.TryParse(dateString, out date)) | ||
{ | ||
Console.WriteLine(date); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("日期字符串无效"); | ||
} | ||
``` | ||
|
||
这种方法允许我们在转换失败时进行适当的处理,而不会导致应用程序崩溃。 | ||
|
||
## 使用 DateTime.ParseExact 方法 | ||
|
||
如果知道字符串的确切格式,可以使用 `DateTime.ParseExact` 方法,指定一个格式化字符串: | ||
|
||
```csharp | ||
string dateString = "09/01/2024"; | ||
DateTime date = DateTime.ParseExact(dateString, "dd/MM/yyyy", CultureInfo.InvariantCulture); | ||
Console.WriteLine(date); | ||
``` | ||
|
||
在上述例子中,我们指定了日期字符串的格式为 "`dd/MM/yyyy`",并使用 `CultureInfo.InvariantCulture` 作为文化信息。 | ||
|
||
::: details 文化信息 | ||
在C#中,`CultureInfo` 是一个表示特定区域性信息的类。它包含了关于语言、国家/地区、日期和时间格式、货币符号等方面的信息。`CultureInfo` 的使用可以确保在进行字符串转换、格式化和解析时,采用了正确的文化习惯,以防止出现意外的行为。 | ||
|
||
`CultureInfo.InvariantCulture` 是 `CultureInfo` 类的一个静态属性,表示一个与任何特定文化相关性都无关的固定格式。使用这个文化信息时,不考虑用户的本地设置,而是使用一个通用的不可变的标准,以确保在不同环境中的一致性。 | ||
|
||
在日期时间处理中,`CultureInfo.InvariantCulture` 通常用于指定日期时间字符串的格式,以防止受到不同文化设置的影响。例如,使用这个文化信息可以确保 "`MM/dd/yyyy`" 的日期格式在任何地方都被正确解释,而不受不同地区日期格式的影响。 | ||
::: | ||
|
||
## 使用 DateTime.TryParseExact 方法 | ||
|
||
`DateTime.TryParseExact` 方法也可用于安全地转换日期字符串: | ||
|
||
```csharp | ||
string dateString = "09/01/2024"; | ||
DateTime date; | ||
if (DateTime.TryParseExact(dateString, "dd/MM/yyyy", CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) | ||
{ | ||
Console.WriteLine(date); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("日期字符串无效"); | ||
} | ||
``` | ||
|
32 changes: 0 additions & 32 deletions
32
docs/《JavaScript教程》笔记/02.JavaScript文章/1110.三级目录/00.四级文件.md
This file was deleted.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
docs/《JavaScript教程》笔记/03.JavaScript笔记/01.使用 js 检测前端返回地址404错误.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: 使用 js 检测前端返回地址404错误 | ||
date: 2024-01-10 10:04:17 | ||
permalink: /pages/ad7a2d/ | ||
categories: | ||
- JavaScript 笔记 | ||
tags: | ||
- js | ||
author: | ||
name: Kronos | ||
link: https://github.com/jywangyou | ||
--- | ||
|
||
浅记在前端中进行404错误检测的方法。 | ||
|
||
## 使用 XMLHttpRequest 对象 | ||
|
||
```js | ||
function check404(url, callback) { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.onreadystatechange = function () { | ||
if (xhr.readyState === 4) { | ||
if (xhr.status === 404) { | ||
callback(true); // 404错误 | ||
} else { | ||
callback(false); // 非404错误 | ||
} | ||
} | ||
}; | ||
xhr.open('GET', url, true); | ||
xhr.send(); | ||
} | ||
|
||
// 使用示例 | ||
var urlToCheck = 'https://example.com/page-not-found'; | ||
check404(urlToCheck, function (is404) { | ||
if (is404) { | ||
console.log('页面不存在!'); | ||
// 处理404错误的逻辑 | ||
} else { | ||
console.log('页面存在!'); | ||
// 处理正常情况的逻辑 | ||
} | ||
}); | ||
``` | ||
|
||
## 使用 [Fetch API](https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API) | ||
|
||
```js | ||
function check404Fetch(url, callback) { | ||
fetch(url) | ||
.then(response => { | ||
if (!response.ok) { | ||
callback(true); // 404错误 | ||
} else { | ||
callback(false); // 非404错误 | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('发生网络错误:', error); | ||
}); | ||
} | ||
|
||
// 使用示例 | ||
var urlToCheck = 'https://example.com/page-not-found'; | ||
check404Fetch(urlToCheck, function (is404) { | ||
if (is404) { | ||
console.log('页面不存在!'); | ||
// 处理404错误的逻辑 | ||
} else { | ||
console.log('页面存在!'); | ||
// 处理正常情况的逻辑 | ||
} | ||
}); | ||
``` | ||
|
||
## 注意 | ||
|
||
在使用上述方法时,需要注意跨域限制。确保你的 JS 代码在访问其他域的资源时得到了允许,否则浏览器会阻止请求。你可能需要在服务器端进行相关配置,以允许跨域请求。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters