陈程的技术博客

  • 关于作者
全栈软件工程师
一个专注于技术研究创新的程序员
.NET

使用WPF在线预览和显示Word和PDF文件

using Spire.Doc; using Spire.Pdf; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.…

2022年1月14日 0条评论 1882点热度 0人点赞 博主 阅读全文
.NET

C# 压缩解压帮助类ZipHelper

先nuget搜索安装System.IO.Compression.ZipFile using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO.Compression; namespace Build_Exe { public class ZipHelper { /// <sum…

2021年11月9日 0条评论 1014点热度 0人点赞 博主 阅读全文
.NET

winfrom 解决PictureBox加载图片后不释放内存问题

using (FileStream lStream = new FileStream(address, FileMode.Open, FileAccess.Read)) { pic_Image.Image = Image.FromStream(lStream); } 使用上面的方法绑定图片,不会抢占本地加载图片的资源。

2021年10月2日 0条评论 1312点热度 0人点赞 博主 阅读全文
python

python快速把office文档execl或者word等转成pdf

import os from win32com.client import Dispatch, constants, gencache, DispatchEx class PDFConverter: def __init__(self, pathname, export='.'): self._handle_postfix = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] self._filename_list = list() self._export_folder …

2021年9月25日 0条评论 1429点热度 0人点赞 博主 阅读全文
python

fastapi做后台的跨域官方BUG以及修复方式

  解决方法如下: def register_cors(app: FastAPI): """ 支持跨域 貌似发现了一个bug https://github.com/tiangolo/fastapi/issues/133 :param app: :return: """ app.add_middleware( CORSMiddleware, # allow_origins=['http://localhost:8081'], # 有效, 但是本地vue端口一直在变化, 接口给其他人用也不一定是这个端口 # …

2021年9月12日 0条评论 1061点热度 0人点赞 博主 阅读全文
web

前端VUE调用接口下载execl出现乱码打不开的问题

原因有2: 第一引用mock导致, 第二下载时需要设置请求 responseType: 'blob' 下载代码如下: export async function DownLoadFile(params) { return request(File_DownLoad,METHOD.GET, params,{responseType: 'blob'}) } download: function (fileId, fileName) { console.log("++++" + fileId); var reqcondi…

2021年9月7日 0条评论 984点热度 0人点赞 博主 阅读全文
linux

记一次fastapi做后台的跨域问题

现在用python的fastapi做了一个后台部署在服务器上,前端采用的vue-ant-admin,直接调用fastapi一直出错   发现是跨域问题,按照网上查询的fastapi做跨域配置: import uvicorn from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware app = FastAPI() origins = [ "http://localhost.tiangolo.com", "ht…

2021年9月6日 0条评论 1424点热度 0人点赞 博主 阅读全文
.NET

C# 采用Automation控制自动化操作第三方软件

自动控制软电话 git:https://gitee.com/zuiyuewentian/automation-micro-sip int pid = 0; private void Form2_Load(object sender, EventArgs e) { Process[] ps = Process.GetProcessesByName("MicroSIP"); if (ps.Length > 0) { foreach (Process p in ps) p.Kill(); } pid = Start…

2021年8月25日 0条评论 1610点热度 0人点赞 博主 阅读全文
python

python版本的图片比较相似度

之前写过有C#版本的功能,此为python版本参考: import cv2 as cv import numpy as np from matplotlib import pyplot as plt from PIL import ImageGrab import os import sys imtest = ImageGrab.grab((0,0,1000,1000)) #可以添加一个坐标元组进去 imtest.save('test.png') img_rgb = cv.imread('test.png') im…

2021年8月25日 0条评论 734点热度 0人点赞 博主 阅读全文
python

python操作隐藏Selenium登录网站的身份指纹

下载指定js: stealth.min.js 操作登录代码: from selenium import webdriver from common.CacheConfig import * from drivers.BaseDriver import BaseDriver class ChromeDriver(BaseDriver): """Chrome 驱动器加载""" def create_driver(self,hasHeader=False): try: options = webdriver.Chrome…

2021年8月25日 0条评论 1340点热度 0人点赞 博主 阅读全文
12345…13
分类
  • .NET (65)
  • docker (3)
  • linux (12)
  • python (20)
  • web (14)
  • 小程序 (4)
  • 数据库 (2)
  • 未分类 (4)
  • 杂七杂八 (10)
标签聚合
python winform centos linux C# js nginx DevExpress
最新 热点 随机
最新 热点 随机
.NET开发手册标准参考 招募兼职前端开发 Centos安装dotnet6环境 VS上切换分支,vs编译运行出现bug,A fatal error was encountered彻底解决方案 用C#封装一个线程安全的缓存器,达到目标定时定量更新入库 C#通过特性的方式去校验指定数据是否为空
centOS 安装 mariadb 机器学习目标检测之印章检测和分类 前端VUE调用接口下载execl出现乱码打不开的问题 一个对缓存操作的类DataCache 剪切pdf分割程图片和pdf winform 绘制无边框拉伸功能,被覆盖边界也可拉伸

COPYRIGHT © 2021 陈程的技术博客. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS