コード例 #1
1
ファイル: App.xaml.cs プロジェクト: IIIArbiIII/MedicineApp
        async Task<bool> UploadDB()
        {
            try
            {
            ServiceReference1.IService1 s = new ServiceReference1.Service1Client();
            Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            Windows.Storage.StorageFile sampleFile = await storageFolder.GetFileAsync("SQLITEV2.sqlite");

            byte[] result;
            using (Stream stream = await sampleFile.OpenStreamForReadAsync())
            {
                using (var memoryStream = new MemoryStream())
                {
                    stream.CopyTo(memoryStream);
                    result = memoryStream.ToArray();
                }
            }

            await s.UploadFileAsync(result);

                return true;
            }
            catch (Exception)
            {
                return false;
                throw;
            }


        }