首页
壁纸
直播
留言板
更多
视频
统计
友情链接
实用工具
Search
1
给孙小姐的一封情书
86 阅读
2
Linux | Linux通过stty命令操作串口设备(linux串口操作命令)
40 阅读
3
armUbuntu系统构建
39 阅读
4
编译 openwrt 及初始配置-及部分排错
37 阅读
5
armUbuntu | uboot常用指令
32 阅读
取次花丛懒回顾
默认分类
C#
MySQL
LabVIEW
Java
Android
PHP
Python
handsome
相册
百度地图
嵌入式
嵌入式Ubuntu
linux
Unity
Golang
Rust
Search
标签搜索
C#
handsome
Git
动态壁纸
开源
Unity3d
Unity
csharp
魔傲手记
累计撰写
114
篇文章
累计收到
18
条评论
首页
栏目
取次花丛懒回顾
默认分类
C#
MySQL
LabVIEW
Java
Android
PHP
Python
handsome
相册
百度地图
嵌入式
嵌入式Ubuntu
linux
Unity
Golang
Rust
页面
壁纸
直播
留言板
视频
统计
友情链接
实用工具
搜索到
91
篇与
的结果
2024-05-29
microsoft e5 developer 常用页面
https://developer.microsoft.com/en-us/microsoft-365/profilehttps://admin.microsoft.com/Adminportal/Home?source=applauncher#/homepagehttps://portal.azure.com/#homehttps://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
2024年05月29日
16 阅读
0 评论
0 点赞
2024-05-28
Docker 安装 Chrome 远程浏览器
1. 前言Kasm Workspaces is a docker container streaming platform for delivering browser-based access to desktops, applications, and web services.Kasm Workspaces是一个Docker容器流媒体平台,用于提供基于浏览器的访问桌面、应用程序和Web服务。Kasm Workspaces提供了一个可通过浏览器访问的 Google Chrome 版本。本文中,我们就来部署一下这个Docker Chrome。参考文档:dockerhub - kasmweb/chrome2. 安装Docker Chrome1、安装Docker Chromedocker run --name chrome -d \ --restart always \ --shm-size=1024m \ -p 6901:6901 \ -e VNC_PW=password123 \ -e LANG=zh_CN.UTF-8 \ -e TZ=Asia/Shanghai \ -u root \ kasmweb/chrome:1.15.0-rolling2、查看运行状态docker ps | grep chrome docker logs chrome3. 使用Docker Chrome1、浏览器访问Chrome假设宿主机地址为 192.168.56.101 ,那么访问地址为:https://192.168.56.101:6901注意是https,不是http。2、登录KasmVNC根据提示,输入用户名和密码,登录KasmVNC用户名为 kasm_user ,密码为 password1233、使用Chrome和本地Chrome基本没有差别,使用起来很方便。Please note that some functionality, such as audio, uploads, downloads, and microphone pass-through, is only available when using Kasm Workspaces for orchestration.请注意,某些功能只有在使用Kasm工作区进行编排时才可用,比如音频、上传、下载和麦克风传递。
2024年05月28日
23 阅读
0 评论
0 点赞
2024-05-28
Wallpaper的原理和C#实现(含源文件)
layout: posttitle: Wallpaper的原理和C#实现(含源文件)date: 章于 2024-04-06 09:36:32 发布author: 'zhangtao'header-img: 'img/post-bg-2015.jpg'catalog: falsetags:-Wallpaper原理和实现-c#wallpaper是一款优秀的动态壁纸软件,除了播放动画以外,还可以执行程序,甚至可以实时响应鼠标移动。windows的桌面是由不同的二窗体构成,包括图标层,背景层,背景层显示桌面壁纸,图标层放置图标,且图标层背景透明,因此可以直接看到后面的背景层,鼠标右键弹出菜单也是在图标层完成。wallpaper在图标层和背景层之间插入了自己的窗口,因此可以显示动画,执行代码。前面已经提到图标层是一个透明的覆盖全屏的大窗口,因此鼠标事件只会在图标层响应,而wallpaper可以实时响应鼠标可能是利用了Hook拦截了鼠标事件,并加入自己代码。既然知道了原理就可以自己实现。首先创建两个窗体,一个用来播放视频,一个用来控制 上图是控制窗口,也是主窗口。另一个视频窗口较为简单,直接用MediaPlayer覆盖全屏就行,注意需要设置WindowState为Maximized,即启动时立即最大化,同时播放器要隐藏ui,即设置uiMode为none。在主窗体的load事件里新建VideoForm。为了让VideoForm能够夹在图标层和背景层中间,需要将VideoForm的父窗体设置为背景窗体。现在需要查找背景窗体的句柄,使用窗口查看器发现背景窗体没有窗体名称,因此无法直接定位,但是我们知道它的类名是WorkW,它的父窗体是Program Manager,所以我们可以遍历所有WorkW窗体,如果其中一个窗体的父窗体是Program Manager,那么这个窗体就是背景窗体。C#不支持直接这种接近底层的操作,因此需要调用user32.dll实现[DllImport("user32.dll", EntryPoint = "SetParent")] private static extern int SetParent(int hWndChild,int hWndNewParent); [DllImport("user32.dll", EntryPoint = "FindWindowA")] private static extern IntPtr FindWindowA(string lpClassName, string lpWindowName); [DllImport("user32.dll", EntryPoint = "FindWindowExA")] private static extern IntPtr FindWindowExA(IntPtr hWndParent, IntPtr hWndChildAfter, string lpszClass, string lpszWindow); [DllImport("user32.dll", EntryPoint = "GetClassNameA")] private static extern IntPtr GetClassNameA(IntPtr hWnd, IntPtr lpClassName, int nMaxCount); [DllImport("user32.dll", EntryPoint = "GetParent")] private static extern IntPtr GetParent(IntPtr hWnd); public static void SetFather(Form form) { SetParent((int)form.Handle, GetBackground()); } private static int GetBackground() { unsafe { IntPtr background = IntPtr.Zero; IntPtr father = FindWindowA("progman", "Program Manager"); IntPtr workerW = IntPtr.Zero; do { workerW = FindWindowExA(IntPtr.Zero, workerW, "workerW", null); if (workerW != IntPtr.Zero) { char[] buff = new char[200]; IntPtr b = Marshal.UnsafeAddrOfPinnedArrayElement(buff, 0); int ret = (int)GetClassNameA(workerW, b, 400); if (ret == 0) throw new Exception("出错"); } if (GetParent(workerW) == father) { background = workerW; } } while (workerW != IntPtr.Zero); return (int)background; } }其中GetBackground函数负责查找背景层窗体,SetFather负责把一个窗体设置成另一个窗体的子窗体。为了使用指针功能,需要先开启不安全的代码功能 :项目—??属性(??是你的项目名称)—允许不安全代码。这个方法在Windows 10 21H1 19043.1110上测试有效,但是不保证在其他系统有效,例如,在vista系统上就会返回空指针,这可能是因为vista系统上的背景窗体不满足上面所讲的关系。一旦返回空指针,会导致设置父窗体失败,最后视频会在图标层上方播放,此时的动态壁纸软件就彻底变成了一个全屏播放器。如果遇到上面这种情况,可以使用MicrosoftSpy来查找背景窗体,并根据具体情况改写上面的代码。这里利用了windows窗口的一个特性:如果A窗体在B窗体上面,那么A窗体也会在B窗体的子窗体上面。给控制窗体的四个按钮写上事件private void Form1_Load(object sender, EventArgs e) { main = new VideoForm(); player = main.player; Window.SetFather(main); main.Show(); } private void button1_Click(object sender, EventArgs e)//打开 { OpenFileDialog open = new OpenFileDialog(); open.Filter = "媒体文件(所有类型)|*.mp4;*.mpeg;*.wma;*.wmv;*.wav;*.avi|所有文件|*.*"; if (open.ShowDialog() == DialogResult.OK) { player.URL = open.FileName; } } private void button2_Click(object sender, EventArgs e)//播放 { player.Ctlcontrols.play(); } private void button3_Click(object sender, EventArgs e)//暂停 { player.Ctlcontrols.pause(); } private void button4_Click(object sender, EventArgs e)//退出 { main.Dispose(); System.Environment.Exit(0); }其中main是视频播放窗体,player是播放器运行点击退出 虽然程序退出了,但是桌面变成了一张白纸,极其难看,目前暂不知道为什么会发生这种情况,个人猜测是windows考虑到背景是一张静态图,所以不会实时刷新,而刚刚被覆盖掉的地方就会保持最后一次刷新的颜色,刚才点击“退出”时,由于先dispose了视频播放窗体,导致背景变成白板,如果不点击“退出”,直接结束进程,那么背景就会变成黑板,因为MediaPlayer就是黑色的既然如此,我们只需要让背景刷新一下就可以,显然在切换壁纸的时候,windows不得不刷新背景,所以我们可以先获取当前壁纸,然后把壁纸切换成当前壁纸,这样实际效果看起来没有任何变化,但是让windows为我们刷新了一次背景。[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")] public static extern int SystemParametersInfo(int uAction, int uParam, StringBuilder lpvParam, int fuWinIni); public static bool Refresh() { StringBuilder wallpaper = new StringBuilder(200); SystemParametersInfo(0x73, 200, wallpaper, 0); int ret = SystemParametersInfo(20, 1, wallpaper, 3); if(ret != 0) { RegistryKey hk = Registry.CurrentUser; RegistryKey run = hk.CreateSubKey(@"Control Panel\Desktop\"); run.SetValue("Wallpaper", wallpaper.ToString()); return true; } return false; }改写“退出”按钮事件private void button4_Click(object sender, EventArgs e)//退出 { main.Hide(); this.Hide(); Window.Refresh(); main.Dispose(); System.Environment.Exit(0); }之所以先隐藏,是因为在dispose和refresh执行的空隙里会有一瞬间的白屏,如果先隐藏就可以避免这种情况。因为视频壁纸需要常驻后台,而控制窗口不可能常驻桌面,所以我们需要改写它的Formclosing,取消窗体关闭事件,并隐藏窗体private void Form1_FormClosing(object sender, FormClosingEventArgs e) { e.Cancel = true; this.Hide(); }给窗体加上NotifyIcon控件,该控件可以显示任务栏角标,改写双击事件,双击角标时显示控制窗体private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.Show(); }到现在完整的Wallpaper已经制作完成,但是目前仅能播放视频。当然也包括图片,但是你需要设置MediaPlayer的循环播放,否则图片显示几秒后就会变成纯黑壁纸。看看GPU占用情况 以上数据是我在播放电影《龙之谷精灵王座》时的资源占用情况,该电影共1.83GB,可以看到内存占用不到100MB,GPU0是核显,核显占用也才2%,比起wallpaper已经非常优秀了,但同时功能也非常单一,不过如果仅仅用来播放视频,完全可以用来替代wallpaper。如果你想要实现更多好玩的功能,也可以往视频播放窗体里加别的东西,但是需要注意一点,所有需要交互的事件都不会响应,比如鼠标点击,你只能通过控制窗体来修改视频播放窗体的内容。源代码:https://gitee.com/y141111/wallpaperEXE文件:https://gitee.com/y141111/wallpaper/releasesEXE文件链接打开后是一个压缩包,里面包含两个dll和一个exe,这三个文件需要放在同一目录下才可以运行
2024年05月28日
18 阅读
0 评论
0 点赞
2024-05-28
让Git忽略所有obj和bin目录的同步
比如说我不希望所有目录(包含子目录)里的obj,bin文件夹以及.user,.suo文件被同步到git服务器,把下面这个.gitignore放到根目录下就可以满足这个需求# compiled files obj bin # user files .user .suoGitHub已经有了一个官方的为Visual Studio项目量身定做的gitignore文件,直接在项目根目录下提交这个文件即可。## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files *.rsuser *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Mono auto generated files mono_crash.* # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ [Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ [Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUnit *.VisualState.xml TestResult.xml nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # Benchmark Results BenchmarkDotNet.Artifacts/ # .NET Core project.lock.json project.fragment.lock.json artifacts/ # ASP.NET Scaffolding ScaffoldingReadMe.txt # StyleCop StyleCopReport.xml # Files built by Visual Studio *_i.c *_p.c *_h.h *.ilk *.meta *.obj *.iobj *.pch *.pdb *.ipdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *_wpftmp.csproj *.log *.tlog *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # Visual Studio Trace Files *.e2e # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # AxoCover is a Code Coverage Tool .axoCover/* !.axoCover/settings.json # Coverlet is a free, cross platform Code Coverage Tool coverage*.json coverage*.xml coverage*.info # Visual Studio code coverage results *.coverage *.coveragexml # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # NuGet Symbol Packages *.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx *.appxbundle *.appxupload # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !?*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs # Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm ServiceFabricBackup/ *.rptproj.bak # SQL Server files *.mdf *.ldf *.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings *.rptproj.rsuser *- [Bb]ackup.rdl *- [Bb]ackup ([0-9]).rdl *- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat node_modules/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw # Visual Studio 6 auto-generated project file (contains which files were open etc.) *.vbp # Visual Studio 6 workspace and project file (working project files containing files to include in project) *.dsw *.dsp # Visual Studio 6 technical files *.ncb *.aps # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # CodeRush personal settings .cr/personal # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Cake - Uncomment if you are using it # tools/** # !tools/packages.config # Tabs Studio *.tss # Telerik's JustMock configuration file *.jmconfig # BizTalk build output *.btp.cs *.btm.cs *.odx.cs *.xsd.cs # OpenCover UI analysis results OpenCover/ # Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log *.binlog # NVidia Nsight GPU debugger configuration file *.nvuser # MFractors (Xamarin productivity tool) working folder .mfractor/ # Local History for Visual Studio .localhistory/ # Visual Studio History (VSHistory) files .vshistory/ # BeatPulse healthcheck temp database healthchecksdb # Backup folder for Package Reference Convert tool in Visual Studio 2017 MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ # Fody - auto-generated XML schema FodyWeavers.xsd # VS Code files for those working on multiple tools .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json *.code-workspace # Local History for Visual Studio Code .history/ # Windows Installer files from build outputs *.cab *.msi *.msix *.msm *.msp # JetBrains Rider *.sln.iml
2024年05月28日
15 阅读
0 评论
0 点赞
2024-05-20
当网站开启 CND 时无法获取访客真实IP
CloudFlare 等 CDN 开启后,NGINX 无法获取访客真实 IP。添加如下配置即可 set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For;
2024年05月20日
19 阅读
0 评论
0 点赞
1
...
8
9
10
...
19