avatar
文章
366
标签
89
分类
53

Home
Archives
Tags
Categories
Link
张拓的博客
搜索
Home
Archives
Tags
Categories
Link

张拓的博客

c++ 调用C# 的DLL
发表于2022-03-19|c++dll
1. 修改cpp属性 常规-》公共语言运行时支持-》选择/clr常规-》调试信息格式-》选择无 代码生成-》启用c++异常-》选择否 代码生成-》基本运行时检查-》选择默认值 命令行-》其它选项-》输入/Zc:twoPhase- 2. c#代码123456789101112131415161718using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace CSharpTest{ public class TestApi { public string Print(string name) { Console.WriteLine(name); return name+name; } }} 3. c++ 代码CSharpLibTest.cpp1234 ...
windows编译libzip vs2017
发表于2022-03-15|build
1 下载libzip-1.8.0zlib-1.2.11解压到H:\devel(自定义) 2 打开工具打开vs 2017的开发人员命令提示符 3 编译zlib12345cd devel\zlib-1.2.11mkdir buildcd buildcmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="h:\include\zlib-vs17"msbuild /P:Configuration=Release INSTALL.vcxproj 注意:正常情况下不会出错。如果之前使用了别的方法编译。应当删除整个目录,重新解压代码。 4 编译libzip123456cd devel\liblzma-4.27.1mkdir buildcd buildcmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX="h:\include\zlib-vs17"msbuild libzip. ...
zlib minizip压缩和解压
发表于2022-03-15|c++
压缩代码zipHelper.h123456789101112131415161718192021#pragma once#ifndef ZIPHELPER_H#define ZIPHELPER_H#include <string>#include "zlib\unzip.h"#include "zlib\zip.h"class ZipHelper{public: // 压缩文件/文件夹 bool ZipDir(const std::string& sourcePath, const std::string& zipPath); ZipHelper(); ~ZipHelper();private: bool AddFileToZip(zipFile zf, const std::string& relative, const std::string& sourcePath); bool AddDirToZip(zipFile zf, const std::st ...
windows system模拟普通用户执行函数
发表于2022-03-04|c++
windows system模拟普通用户执行函数1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980bool ChangeToken(const std::string &path){#define INFO_BUFFER_SIZE 32767 char infoBuf[INFO_BUFFER_SIZE]; DWORD bufCharCount = INFO_BUFFER_SIZE; if (!GetUserNameA(infoBuf, &bufCharCount)) { LOG_ERROR("GetUserName error!"); } else &# ...
python Hex或Unicode反斜杠转义恢复
发表于2022-02-22|python
python Hex或Unicode反斜杠转义恢复 1234audio = '"\\xe9\\xba\\xa6\\xe5\\x85\\x8b\\xe9\\xa3\\x8e (HIK 1080P Camera-Audio)"'a1 = codecs.escape_decode(audio, 'hex-escape')[0]a2 = a1.decode("utf-8")print(a2) 1"麦克风 (HIK 1080P Camera-Audio)"
ffmpeg推rtsp、rtmp音视频流命令
发表于2022-02-18|ffmpeg
ffmpeg推rtsp、rtmp音视频流命令视音频rtmp流,服务器nginx+rtmp-module1ffmpeg -f dshow -i audio="麦克风 (HIK 1080P Camera-Audio)" -f dshow -i video="HIK 1080P Camera" -acodec aac -ac 2 -ar 44100 -vcodec libx264 -f flv rtmp://192.168.1.142:2022/hls/live0 播放1ffplay rtmp://192.168.1.142:2022/hls/live0 视音频rtsp流,服务器EasyDarwin1ffmpeg -f dshow -i audio="麦克风 (HIK 1080P Camera-Audio)" -f dshow -i video="HIK 1080P Camera" -acodec aac -ac 2 -ar 44100 -vcodec libx264 -rtsp_transport tcp -f ...
python根据SVN版本号生成version.h
发表于2022-02-17|python
python生成version.h 1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/usr/bin/python# -*- coding: UTF-8 -*-import sysimport reimport osdef open_file(name, flag): try: f = open(name, flag) return f except BaseException: return None return Nonedef run(): try: rd = os.popen("svn info | findstr Revision:") revision = rd.read() search = re.search("\d+", revision) if not search: re ...
windows服务在桌面打开文件
发表于2022-01-26|c++win32
run.bat1start "" %1 代码123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#include "windows.h"#include <WtsApi32.h>#include <UserEnv.h>#include <tlhelp32.h>#include "base/charset.h"#include <tchar.h>#include <winbase.h>#pragma comment(lib, "WtsApi32.lib")#pragma comment(lib, "UserEnv.lib")BOOL RunExec(const TCHAR* path){ HANDLE hToken = 0; HANDLE hProcessSnap ...
boost 拆分字符串
发表于2021-11-09|c++boost
例子:123std::vector<std::string> ipsVec;ips="192.168.1.4;192.168.1.5;192.168.1.6;";boost::split(ipsVec, ips, boost::is_any_of(";")); Function template splitboost::algorithm::split — Split algorithm. Synopsis12345// In header: <boost/algorithm/string/split.hpp>template<typename SequenceSequenceT, typename RangeT, typename PredicateT> SequenceSequenceT & split(SequenceSequenceT & Result, RangeT & Input, PredicateT Pred, token_compress_mod ...
使用boost解析有中文的json
发表于2021-11-02|c++boost
代码1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556// 解析JSONvoid TestBoostJson() { std::cout << "TestBoostJson" << "\n"; // serialize boost::json::object org; org["name"] = "你好啊\\ AA BB CC 联通 鸡蛋灌饼 !()"; std::cout << "name:\t"<<org["name"] << "\n"; auto szJson = boost::json::serialize(org); std::cout << "json ...
1…181920…37
avatar
张拓
多情自古空余恨,好梦由来最易醒
文章
366
标签
89
分类
53
Follow Me
公告
每天都有一个好心情
最新文章
windows编译libtorrent
windows编译libtorrent2024-05-23
windows编译boost
windows编译boost2024-05-08
vscode远程调试linux
vscode远程调试linux2023-12-21
linux服务检查进程
linux服务检查进程2023-12-01
ubuntu配置vnc服务
ubuntu配置vnc服务2023-11-03
分类
  • algorithm81
    • maze1
    • search34
    • sort33
  • aws7
  • boost7
  • build2
  • c++110
标签
database pygame samb odbc url cocos ocx rejson libzip samba 文本转语音 vs hex search thread win32 lua ffmpeg shared memory asio ssh cpp redis python TortriseGit decode quota uac .map qemu sql wordpress bitmap 杂 livecd py ustar ubuntu proxy dbg
归档
  • 五月 20242
  • 十二月 20232
  • 十一月 20231
  • 九月 20232
  • 八月 20236
  • 七月 202310
  • 六月 20234
  • 五月 202310
网站资讯
文章数目 :
366
本站访客数 :
本站总访问量 :
最后更新时间 :
©2020 - 2025 By 张拓
框架 Hexo|主题 Butterfly
京ICP备2022021138号-1
搜索
数据库加载中