检测UWP中的股份合约

时间:2016-10-03 03:47:45

标签: uwp share contract

我知道无法与xbox one中的其他应用共享文件,但我不知道如何检查?我猜它是使用ApiInformation,但是怎么样?

注意我知道如何检查设备系列,但我想检查该功能,所以当在xbox中实现共享功能时,我不需要更改应用程序。

2 个答案:

答案 0 :(得分:0)

自Windows 10周年更新(又名RS1)以来,这是可行的。如果您将属性中的目标版本更改为Windows 10 Anniversary Edition (10.0; Build 14393)
enter image description here 然后,您可以使用DataTransferManager.IsSupported方法确定设备是否支持共享。如果设备支持共享,则此方法返回true,否则返回false。

答案 1 :(得分:0)

如果您仍需要解决方案,out_charset="ABCDEFGHIJKLMNOPQRSTUVWXYZ" def input_pipeline(data_filename): filenames,seq_labels = _get_image_filenames_labels(data_filename) data_queue = tf.train.slice_input_producer([filenames, seq_labels]) image,label = _read_data_format(data_queue) image,label = tf.train.batch([image,label],batch_size=2,dynamic_pad=True) label = tf.deserialize_many_sparse(label,tf.int32) return image,label def _get_image_filenames_labels(data_filename): filenames = [] labels = [] with open(data_filename)) as f: for line in f: # Carve out the ground truth string and file path from # lines formatted like: # ./241/7/158_NETWORK_51375.jpg 51375 filename = line.split(' ',1)[0][2:] # split off "./" and number # Extract label string embedded within image filename # between underscores, e.g. NETWORK text = os.path.basename(filename).split('_',2)[1] # Transform string text to sequence of indices using charset, e.g., # NETWORK -> [13, 4, 19, 22, 14, 17, 10] indices = [[i] for i in range(0,len(text))] values = [out_charset.index(c) for c in list(text)] shape = [len(text)] label = tf.SparseTensorValue(indices,values,shape) label = tf.convert_to_tensor_or_sparse_tensor(label) label = tf.serialize_sparse(label) # needed for batching # Add data to lists for conversion filenames.append(filename) labels.append(label) filenames = tf.convert_to_tensor(filenames) labels = tf.convert_to_tensor_or_sparse_tensor(labels) return filenames, labels def _read_data_format(data_queue): label = data_queue[1] raw_image = tf.read_file(data_queue[0]) image = tf.image.decode_jpeg(raw_image,channels=1) return image,label 现在有一个名为DataTransferManager的方法。

检查reply我的问题。