質問編集履歴

5

追記5

2017/07/09 07:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -157,3 +157,291 @@
157
157
 
158
158
 
159
159
  ![![イメージ説明](1db738360fb9810b88d1bd62d49c55a7.png)](l.png)
160
+
161
+
162
+
163
+
164
+
165
+ ###現在のApp.xaml.csのコード
166
+
167
+
168
+
169
+ __一部伏字__,
170
+
171
+ using ********の********は追記4の茶色く塗ってるやつ
172
+
173
+ 後半はテンプレートそのままです。
174
+
175
+
176
+
177
+ ```
178
+
179
+ using System;
180
+
181
+ using System.Collections.Generic;
182
+
183
+ using System.IO;
184
+
185
+ using System.Linq;
186
+
187
+ using System.Runtime.InteropServices.WindowsRuntime;
188
+
189
+ using Windows.ApplicationModel;
190
+
191
+ using Windows.ApplicationModel.Activation;
192
+
193
+ using Windows.Foundation;
194
+
195
+ using Windows.Foundation.Collections;
196
+
197
+ using Windows.UI.Xaml;
198
+
199
+ using Windows.UI.Xaml.Controls;
200
+
201
+ using Windows.UI.Xaml.Controls.Primitives;
202
+
203
+ using Windows.UI.Xaml.Data;
204
+
205
+ using Windows.UI.Xaml.Input;
206
+
207
+ using Windows.UI.Xaml.Media;
208
+
209
+ using Windows.UI.Xaml.Navigation;
210
+
211
+ using *********;
212
+
213
+ using System.Net.Http;
214
+
215
+ using System.Net.Http.Headers;
216
+
217
+ using System.Threading.Tasks;
218
+
219
+
220
+
221
+ namespace TRUE
222
+
223
+ {
224
+
225
+
226
+
227
+ /// <summary>
228
+
229
+ /// 既定の Application クラスを補完するアプリケーション固有の動作を提供します。
230
+
231
+ /// </summary>
232
+
233
+ sealed partial class App : Application
234
+
235
+ {
236
+
237
+ /// <summary>
238
+
239
+ /// 単一アプリケーション オブジェクトを初期化します。これは、実行される作成したコードの
240
+
241
+ ///最初の行であるため、main() または WinMain() と論理的に等価です。
242
+
243
+ /// </summary>
244
+
245
+ static readonly Uri endpointUri = new Uri("https://*********");
246
+
247
+
248
+
249
+ public App()
250
+
251
+ {
252
+
253
+ this.InitializeComponent();
254
+
255
+ this.Suspending += OnSuspending;
256
+
257
+
258
+
259
+ }
260
+
261
+
262
+
263
+
264
+
265
+ public static async Task Main()
266
+
267
+ {
268
+
269
+
270
+
271
+ var method = "***";
272
+
273
+ var path = "/v1/*******";
274
+
275
+ var query = "";
276
+
277
+
278
+
279
+ using (var client = new HttpClient())
280
+
281
+ using (var request = new HttpRequestMessage(new HttpMethod(method), path + query))
282
+
283
+ {
284
+
285
+ client.BaseAddress = endpointUri;
286
+
287
+ var message = await client.SendAsync(request);
288
+
289
+ var response = await message.Content.ReadAsStringAsync();
290
+
291
+ TextBox1.Text = "...??";
292
+
293
+
294
+
295
+
296
+
297
+ //Console.WriteLine(response);
298
+
299
+ }
300
+
301
+
302
+
303
+ }
304
+
305
+
306
+
307
+
308
+
309
+ /// <summary>
310
+
311
+ /// アプリケーションがエンド ユーザーによって正常に起動されたときに呼び出されます。他のエントリ ポイントは、
312
+
313
+ /// アプリケーションが特定のファイルを開くために起動されたときなどに使用されます。
314
+
315
+ /// </summary>
316
+
317
+ /// <param name="e">起動の要求とプロセスの詳細を表示します。</param>
318
+
319
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
320
+
321
+ {
322
+
323
+ Frame rootFrame = Window.Current.Content as Frame;
324
+
325
+
326
+
327
+ // ウィンドウに既にコンテンツが表示されている場合は、アプリケーションの初期化を繰り返さずに、
328
+
329
+ // ウィンドウがアクティブであることだけを確認してください
330
+
331
+ if (rootFrame == null)
332
+
333
+ {
334
+
335
+ // ナビゲーション コンテキストとして動作するフレームを作成し、最初のページに移動します
336
+
337
+ rootFrame = new Frame();
338
+
339
+
340
+
341
+ rootFrame.NavigationFailed += OnNavigationFailed;
342
+
343
+
344
+
345
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
346
+
347
+ {
348
+
349
+ //TODO: 以前中断したアプリケーションから状態を読み込みます
350
+
351
+ }
352
+
353
+
354
+
355
+ // フレームを現在のウィンドウに配置します
356
+
357
+ Window.Current.Content = rootFrame;
358
+
359
+ }
360
+
361
+
362
+
363
+ if (e.PrelaunchActivated == false)
364
+
365
+ {
366
+
367
+ if (rootFrame.Content == null)
368
+
369
+ {
370
+
371
+ // ナビゲーション スタックが復元されない場合は、最初のページに移動します。
372
+
373
+ // このとき、必要な情報をナビゲーション パラメーターとして渡して、新しいページを
374
+
375
+ //構成します
376
+
377
+ rootFrame.Navigate(typeof(MainPage), e.Arguments);
378
+
379
+ }
380
+
381
+ // 現在のウィンドウがアクティブであることを確認します
382
+
383
+ Window.Current.Activate();
384
+
385
+ }
386
+
387
+ }
388
+
389
+
390
+
391
+ /// <summary>
392
+
393
+ /// 特定のページへの移動が失敗したときに呼び出されます
394
+
395
+ /// </summary>
396
+
397
+ /// <param name="sender">移動に失敗したフレーム</param>
398
+
399
+ /// <param name="e">ナビゲーション エラーの詳細</param>
400
+
401
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
402
+
403
+ {
404
+
405
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
406
+
407
+ }
408
+
409
+
410
+
411
+ /// <summary>
412
+
413
+ /// アプリケーションの実行が中断されたときに呼び出されます。
414
+
415
+ /// アプリケーションが終了されるか、メモリの内容がそのままで再開されるかに
416
+
417
+ /// かかわらず、アプリケーションの状態が保存されます。
418
+
419
+ /// </summary>
420
+
421
+ /// <param name="sender">中断要求の送信元。</param>
422
+
423
+ /// <param name="e">中断要求の詳細。</param>
424
+
425
+ private void OnSuspending(object sender, SuspendingEventArgs e)
426
+
427
+ {
428
+
429
+ var deferral = e.SuspendingOperation.GetDeferral();
430
+
431
+ //TODO: アプリケーションの状態を保存してバックグラウンドの動作があれば停止します
432
+
433
+ deferral.Complete();
434
+
435
+ }
436
+
437
+ }
438
+
439
+ }
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+ ```

4

追記4

2017/07/09 07:29

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -147,3 +147,13 @@
147
147
  ConsoleじゃなくてMainPage.xamlのテキストボックスに書き出せばいいのかな?????????????
148
148
 
149
149
  どうすればいいんだろう
150
+
151
+
152
+
153
+
154
+
155
+ ###追記4
156
+
157
+
158
+
159
+ ![![イメージ説明](1db738360fb9810b88d1bd62d49c55a7.png)](l.png)

3

追記3

2017/07/09 07:12

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -137,3 +137,13 @@
137
137
  [いまここを発見しました。](https://docs.microsoft.com/ja-jp/windows/uwp/get-started/create-a-hello-world-app-xaml-universal)
138
138
 
139
139
  解決できそうな気がする。(まだ読んでない)
140
+
141
+
142
+
143
+
144
+
145
+ ###追記3
146
+
147
+ ConsoleじゃなくてMainPage.xamlのテキストボックスに書き出せばいいのかな?????????????
148
+
149
+ どうすればいいんだろう

2

追記

2017/07/09 05:57

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -121,3 +121,19 @@
121
121
  project.json:コマンド実行を定義するファイル
122
122
 
123
123
  らしいですがApp.xamlにソースコードを書き込んでも同様のエラーが出ます
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ ###追記2
132
+
133
+ Microsoft Visual Studio Community 2017,Version15.2(26430.15)Releaseです。TemplateはVisual C#のWindows ユニバーサル、空白のアプリ(Windows ユニバーサル)です。調べてみたところ、「Windowsアプリケーションでの開発環境なのでコンソールアプリケーションのConsole.writelineは使えない」というようなことらしいです。試しにコンソールアプリケーションとして実行しようとしましたが出力の種類が先述のver?では変更できません。また、おそらくusing System.Windows.Formsと記述すると「ない」と出るのでそこをどうにかするといくかもしれないと思っています。当方完全にプログラミングに関して無知なので用語などがおかしいと思いますがご容赦ください。
134
+
135
+
136
+
137
+ [いまここを発見しました。](https://docs.microsoft.com/ja-jp/windows/uwp/get-started/create-a-hello-world-app-xaml-universal)
138
+
139
+ 解決できそうな気がする。(まだ読んでない)

1

追記1

2017/07/09 05:40

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -93,3 +93,31 @@
93
93
 
94
94
 
95
95
  _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_ _(:3」∠)_
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ ###追記1
106
+
107
+ Properties:アプリのプロパティ情報
108
+
109
+ 参照
110
+
111
+ Assets:アプリ起動時に表示される画像ファイル
112
+
113
+ App.xaml:アプリの C# コードファイル
114
+
115
+ ApplicationInsights.config:構成ファイル
116
+
117
+ MainPage.xaml:アプリ画面の XAML ファイル
118
+
119
+ Package.appxmanifest:設定情報を含むマニュフェストファイル
120
+
121
+ project.json:コマンド実行を定義するファイル
122
+
123
+ らしいですがApp.xamlにソースコードを書き込んでも同様のエラーが出ます