Buckets:
1.06 GB
1,825 files
Updated about 2 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| README.md | 1.79 kB xet | 60c07352 | |
| TdExample.cs | 11.7 kB xet | 001d1826 | |
| TdExample.csproj | 5.19 kB xet | 10ac0672 | |
| TdExample.sln | 1.39 kB xet | 02479d21 |
TDLib C# example
This is an example of building TDLib with C++/CLI support and an example of TDLib usage from C#.
Building TDLib
- Download and install Microsoft Visual Studio 2015 or later.
- Download and install CMake; choose "Add CMake to the system PATH" option while installing.
- Install
gperf,zlib, andopensslusing vcpkg:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout bc3512a509f9d29b37346a7e7e929f9a26e66c7e
.\bootstrap-vcpkg.bat
.\vcpkg.exe install gperf:x64-windows gperf:x86-windows openssl:x64-windows openssl:x86-windows zlib:x64-windows zlib:x86-windows
- (Optional. For XML documentation generation.) Download PHP. Add the path to php.exe to the PATH environment variable.
- Build
TDLibwith CMake enabling.NETsupport and specifying correct path tovcpkgtoolchain file:
cd <path to TDLib sources>/example/csharp
mkdir build
cd build
cmake -A Win32 -DTD_ENABLE_DOTNET=ON -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg>/scripts/buildsystems/vcpkg.cmake ../../..
cmake --build . --config Release
cmake --build . --config Debug
cd ..
mkdir build64
cd build64
cmake -A x64 -DTD_ENABLE_DOTNET=ON -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg>/scripts/buildsystems/vcpkg.cmake ../../..
cmake --build . --config Release
cmake --build . --config Debug
Example of usage
After TDLib is built you can open and run TdExample project.
It contains a simple console C# application with implementation of authorization and message sending.
Just open it with Visual Studio 2015 or later and run.
Also, see TdExample.csproj for example of including TDLib in C# project with all native shared library dependencies.
- Total size
- 1.06 GB
- Files
- 1,825
- Last updated
- Sep 19
- Pre-warmed CDN
- US EU US EU