【发布时间】:2015-06-18 10:54:25
【问题描述】:
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
{
}
}
当我调试代码时,此代码工作正常。但是当我在没有调试操作的情况下运行代码时无法执行。当我调试此代码时,它工作正常。我怎么了。
![打印演示][10![]]1
【问题讨论】:
-
为什么要大写?
-
听不懂你说什么
标签: windows-phone-7 windows-phone-8 windows-phone windows-phone-8.1 windows-phone-7.1