質問編集履歴

4

2018/01/09 06:14

投稿

yukkuri_emilin
yukkuri_emilin

スコア8

test CHANGED
File without changes
test CHANGED
@@ -142,7 +142,7 @@
142
142
 
143
143
  public int inital = 0;
144
144
 
145
- public OAuthSession oauth = Authorize("AGCFWxBG3kSoXmmCPh8t8A5A6", "j5tXJ7BfWj9EscWC4qUE282VFKBpPWtRUavrxNozpv0YBl7C2l");
145
+ public OAuthSession oauth = Authorize("", "");
146
146
 
147
147
  public MainWindow()
148
148
 

3

補足追記

2018/01/09 06:14

投稿

yukkuri_emilin
yukkuri_emilin

スコア8

test CHANGED
File without changes
test CHANGED
@@ -330,6 +330,16 @@
330
330
 
331
331
  ###補足情報(言語/FW/ツール等のバージョンなど)
332
332
 
333
+ ソースは上から
334
+
335
+ MainWindow.xaml
336
+
337
+ MainWindow.xaml.cs
338
+
339
+ Token.xaml
340
+
341
+ Token.xaml.cs
342
+
333
343
  環境はVisualStudio2017
334
344
 
335
345
  C#とXaml

2

他のファイルのコードも記入しました。

2018/01/08 11:35

投稿

yukkuri_emilin
yukkuri_emilin

スコア8

test CHANGED
File without changes
test CHANGED
@@ -86,7 +86,247 @@
86
86
 
87
87
  ```
88
88
 
89
-
89
+ ```MainWindow.xaml.cs
90
+
91
+ using System;
92
+
93
+ using System.Collections.Generic;
94
+
95
+ using System.Linq;
96
+
97
+ using System.Text;
98
+
99
+ using System.Windows;
100
+
101
+ using System.Windows.Controls;
102
+
103
+ using System.Windows.Data;
104
+
105
+ using System.Windows.Documents;
106
+
107
+ using System.Windows.Input;
108
+
109
+ using System.Windows.Media;
110
+
111
+ using System.Windows.Media.Imaging;
112
+
113
+ using System.Windows.Navigation;
114
+
115
+ using System.Windows.Shapes;
116
+
117
+ using CoreTweet;
118
+
119
+ using System.Diagnostics;
120
+
121
+ using static CoreTweet.OAuth;
122
+
123
+
124
+
125
+ namespace TweetOnlyClient
126
+
127
+ {
128
+
129
+ /// <summary>
130
+
131
+ /// MainWindow.xaml の相互作用ロジック
132
+
133
+ /// </summary>
134
+
135
+ public partial class MainWindow : Window
136
+
137
+ {
138
+
139
+ public Tokenss tokensa = new Tokenss();
140
+
141
+ public Tokens tokens;
142
+
143
+ public int inital = 0;
144
+
145
+ public OAuthSession oauth = Authorize("AGCFWxBG3kSoXmmCPh8t8A5A6", "j5tXJ7BfWj9EscWC4qUE282VFKBpPWtRUavrxNozpv0YBl7C2l");
146
+
147
+ public MainWindow()
148
+
149
+ {
150
+
151
+ InitializeComponent();
152
+
153
+ if (inital == 0)
154
+
155
+ {
156
+
157
+ tokensa.Show();
158
+
159
+ Hide();
160
+
161
+ inital++;
162
+
163
+ }
164
+
165
+ }
166
+
167
+
168
+
169
+ private void Window_KeyDown(object sender, KeyEventArgs e)
170
+
171
+ {
172
+
173
+ if(e.Key == Key.LeftCtrl||e.Key == Key.RightCtrl&&e.Key == Key.Enter)
174
+
175
+ {
176
+
177
+ if (TweetBOx.Text == null || TweetBOx.Text == "")
178
+
179
+ {
180
+
181
+ tokens.Statuses.Update(status => TweetBOx.Text);
182
+
183
+ TweetBOx.Text = "";
184
+
185
+ }
186
+
187
+ }
188
+
189
+ }
190
+
191
+
192
+
193
+ private void Tweet_Click(object sender, RoutedEventArgs e)
194
+
195
+ {
196
+
197
+ tokens.Statuses.Update(status => TweetBOx.Text);
198
+
199
+ TweetBOx.Text = "";
200
+
201
+ }
202
+
203
+ }
204
+
205
+ }
206
+
207
+ ```
208
+
209
+ ```Token.xaml
210
+
211
+ <Window x:Class="TweetOnlyClient.Tokenss"
212
+
213
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
214
+
215
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
216
+
217
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
218
+
219
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
220
+
221
+ xmlns:local="clr-namespace:TweetOnlyClient"
222
+
223
+ mc:Ignorable="d"
224
+
225
+ Title="取得したPINを入力してください。" Height="101" Width="200" Activated="Window_Activated">
226
+
227
+ <Grid>
228
+
229
+ <TextBox Name="TextBox1" HorizontalAlignment="Left" Height="23" Margin="10,35,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="90"/>
230
+
231
+ <Label Content="取得したPINを入力してください。" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top"/>
232
+
233
+ <Button Content="Submit" HorizontalAlignment="Left" Margin="105,35,0,0" VerticalAlignment="Top" Width="75" Height="23" Click="Button_Click"/>
234
+
235
+
236
+
237
+ </Grid>
238
+
239
+ </Window>
240
+
241
+ ```
242
+
243
+ ```Token.xaml.cs
244
+
245
+ using System;
246
+
247
+ using System.Collections.Generic;
248
+
249
+ using System.Linq;
250
+
251
+ using System.Text;
252
+
253
+ using System.Windows;
254
+
255
+ using System.Windows.Controls;
256
+
257
+ using System.Windows.Data;
258
+
259
+ using System.Windows.Documents;
260
+
261
+ using System.Windows.Input;
262
+
263
+ using System.Windows.Media;
264
+
265
+ using System.Windows.Media.Imaging;
266
+
267
+ using System.Windows.Shapes;
268
+
269
+ using CoreTweet;
270
+
271
+
272
+
273
+ namespace TweetOnlyClient
274
+
275
+ {
276
+
277
+ /// <summary>
278
+
279
+ /// Token.xaml の相互作用ロジック
280
+
281
+ /// </summary>
282
+
283
+ public partial class Tokenss : Window
284
+
285
+ {
286
+
287
+ public static MainWindow main = new MainWindow();
288
+
289
+ public Tokenss()
290
+
291
+ {
292
+
293
+ InitializeComponent();
294
+
295
+ System.Diagnostics.Process.Start(main.oauth.AuthorizeUri.AbsoluteUri);
296
+
297
+ }
298
+
299
+
300
+
301
+ private void Button_Click(object sender, RoutedEventArgs e)
302
+
303
+ {
304
+
305
+ main.tokens = main.oauth.GetTokens(TextBox1.Text);
306
+
307
+ main.Show();
308
+
309
+ Hide();
310
+
311
+ }
312
+
313
+
314
+
315
+ private void Window_Activated(object sender, EventArgs e)
316
+
317
+ {
318
+
319
+
320
+
321
+ }
322
+
323
+ }
324
+
325
+ }
326
+
327
+
328
+
329
+ ```
90
330
 
91
331
  ###補足情報(言語/FW/ツール等のバージョンなど)
92
332
 

1

初心者マークをつけただけです

2018/01/08 11:31

投稿

yukkuri_emilin
yukkuri_emilin

スコア8

test CHANGED
File without changes
test CHANGED
File without changes