> For the complete documentation index, see [llms.txt](https://docs.hostedgraphite.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostedgraphite.com/language-guide/.net.md).

# .NET

### Interesting .NET Metrics Libraries

* **A simple .NET library for Graphite and StatsD**\
  <https://github.com/ragnard/Graphite.NET> - A simple .NET library to collects stats and pass them on to Graphite
* **A .NET library to send data to Hosted Graphite**\
  Client library to send statistics to HostedGraphite.com using .Net, a work-in-progress

### Sending a metric via UDP

```
var endPoint = new IPEndPoint(Dns.GetHostAddresses("carbon.hostedgraphite.com")[0], 2003);
var bytes = Encoding.ASCII.GetBytes("YOUR-API-KEY.foo.net-udp 1.2\n");
var sock = new Socket(AddressFamily.InterNetwork,SocketType.Dgram, ProtocolType.Udp) { Blocking = false };
sock.SendTo(bytes, endPoint);
```

Your API key can be found on your [account home](https://www.hostedgraphite.com/accounts/profile/) page.
