string command = "Welcome To Solutions.... ";
Byte[] buffer = new byte[command.Length];
StreamSocket socket = null;
buffer = StringToAscii(command);
PeerFinder.AlternateIdentities["Bluetooth:Paired"] = "";
var pairedDevices = await PeerFinder.FindAllPeersAsync();
if (pairedDevices.Count == 0)
{
Debug.WriteLine("No paired devices were found.");
}
else
{
try
{
PeerInformation selectedDevice = pairedDevices[0];
socket = new StreamSocket();
await socket.ConnectAsync(selectedDevice.HostName, "1");
await socket.OutputStream.WriteAsync(WindowsRuntimeBufferExtensions.AsBuffer(buffer));
socket.Dispose();
Array.Clear(buffer, 0, buffer.Length);
}
catch
{
}
}
This Code Working Fine When i Debug the code. But When i Run the code without Debugging Action cannot performed. when i debuig this code it's Working fine. what wrong with me.
![Printind demo][10![]]1
I don't know what printer are you using but you need to specify some commands. For Zebra printers your code looks something like this:
Verify that your Release mode allows code optimization.