This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Answer | |
| { | |
| public string answer { get; set; } | |
| public List<string> questions { get; set; } | |
| public decimal score { get; set; } | |
| } | |
| public class QnAresponse | |
| { | |
| public List<Answer> answers { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //建立ImgurClient(其中的"CLIENT_ID", "CLIENT_SECRET"要換成你自己的) | |
| var client = new ImgurClient(CLIENT_ID, CLIENT_SECRET); | |
| var endpoint = new ImageEndpoint(client); | |
| IImage image; | |
| //取得圖片檔案FileStream | |
| using (var fs = new FileStream(FilePath, FileMode.Open)) | |
| { | |
| image = endpoint.UploadImageStreamAsync(fs).GetAwaiter().GetResult(); | |
| } | |
| //顯示圖檔位置 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //回覆tempalte | |
| var actions = new List<isRock.LineBot.TemplateActionBase>(); | |
| actions.Add(new isRock.LineBot.MessageAction() { label = "標題-文字回覆", text = "回覆文字" }); | |
| actions.Add(new isRock.LineBot.UriAction() { label = "標題-Google", uri = new Uri("http://www.google.com") }); | |
| actions.Add(new isRock.LineBot.PostbackAction() { label = "標題-發生postack", data = "abc=aaa&def=111" }); | |
| var tmp = new isRock.LineBot.ButtonsTemplate() | |
| { | |
| text = "ButtonsTemplate文字訊息", | |
| title = "ButtonsTemplate標題", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\在此開啟CmdLine] | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\在此開啟CmdLine\command] | |
| @="\"C:\\Windows\\System32\\cmd.exe\" /k \"cd %L\"" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rem 讓用戶輸入 port變數 | |
| set /p port="input port: " | |
| rem 切換到你的ngrok資料夾(請自行調整) | |
| path "C:\ngrok" | |
| rem 直接將port NO.帶入執行ngrok | |
| ngrok http %port% -host-header="localhost:%port%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| isRock.LineBot.TextMessage msg = | |
| new isRock.LineBot.TextMessage("請問你要請什麼假別?"); | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyMessageAction( | |
| "特休", "特休", new Uri("https://arock.blob.core.windows.net/blogdata201809/if_resolutions-25_897228.png"))); | |
| msg.quickReply.items.Add( | |
| new isRock.LineBot.QuickReplyMessageAction( | |
| "事假", "事假", new Uri("https://arock.blob.core.windows.net/blogdata201809/if_busy_83242.png"))); | |
| msg.quickReply.items.Add( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //重新issue一個 short-lived token | |
| var token = isRock.LineBot.Utility.IssueChannelAccessToken(Channel_ID, Channel_Secret); | |
| //顯示在TextBox1中 | |
| this.TextBox1.Text = token.access_token; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "firstName": "John", | |
| "lastName": "Smith", | |
| "sex": "male", | |
| "age": 25, | |
| "address": | |
| { | |
| "streetAddress": "21 2nd Street", | |
| "city": "New York", | |
| "state": "NY", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //取得特定ChannelAccessToken名下所有的Liff Apps | |
| var Liff = isRock.LIFF.Utility.GetAllLiffApps(ChannelAccessToken); | |
| //列舉所有Liff Apps | |
| foreach (var item in Liff.apps) | |
| { | |
| Response.Write($"<br>liffId : {item.liffId}"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await context.PostAsync($"{this.count++}: 親愛的,你說了 '{message.Text}' , 我有聽到......"); | |