Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wtrsltnk/system.net
Partial c++ implementation of .NET System.Net classes
https://github.com/wtrsltnk/system.net
cpp net system-net systemnet sytem winsock2
Last synced: about 13 hours ago
JSON representation
Partial c++ implementation of .NET System.Net classes
- Host: GitHub
- URL: https://github.com/wtrsltnk/system.net
- Owner: wtrsltnk
- Created: 2018-03-13T20:41:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T20:54:38.000Z (about 1 year ago)
- Last Synced: 2023-11-16T21:54:52.770Z (about 1 year ago)
- Topics: cpp, net, system-net, systemnet, sytem, winsock2
- Language: C
- Homepage:
- Size: 868 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# system.net
Partial c++ implementation of .NET System.Net classes
## Example Hello World
```c++
#include
#include
#includeusing namespace System::Net::Http;
int main(int argc, char* argv[])
{
HttpListener listener;listener.Prefixes().push_back("http://localhost:8383/");
try
{
listener.Start();auto context = listener.GetContext();
context->Response()->WriteResponse("
Hello world
");
context->Response()->Close();
delete context;listener.Stop();
}
catch (HttpListenerException const *ex)
{
std::cout << "Exception in http listener: " << ex->Message() << "\n";
}return 0;
}```
## Example Redirect
```c++
#include
#include
#includeusing namespace System::Net::Http;
int main(int argc, char* argv[])
{
HttpListener listener;listener.Prefixes().push_back("http://localhost:8383/");
try
{
listener.Start();auto context = listener.GetContext();
context->Response()->Redirect("https://github.com/wtrsltnk");
delete context;listener.Stop();
}
catch (HttpListenerException const *ex)
{
std::cout << "Exception in http listener: " << ex->Message() << "\n";
}return 0;
}```