Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created November 21, 2023 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/22676d2c303e3035cb2470b9e3de6993 to your computer and use it in GitHub Desktop.
Save bjoerntx/22676d2c303e3035cb2470b9e3de6993 to your computer and use it in GitHub Desktop.
[HttpPost]
public HttpResponseMessage LoadDocument(string ConnectionID)
{
// connect the WebSocketHandler with the ConnectionID
WebSocketHandler wsHandler = WebSocketHandler.GetInstance(ConnectionID);
// the document directly server-side
wsHandler.LoadText("App_Data/demo.tx", StreamType.InternalUnicodeFormat);
return new HttpResponseMessage()
{
StatusCode = HttpStatusCode.OK
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment