This file contains 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
using System; | |
using System.Collections.Generic; | |
namespace imagemaptest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var AdminUserId = "___________AdminUserId____________"; |
This file contains 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
using System; | |
using System.Collections.Generic; | |
namespace imagemaptest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var AdminUserId = "___AdminUserId___"; |
This file contains 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
using System; | |
using System.Collections.Generic; | |
namespace linepushtest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var AdminUserId = "___AdminUserId___"; |
This file contains 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
//發送ImageMap | |
isRock.LineBot.Bot bot = new isRock.LineBot.Bot(ChannelAccessToken); | |
var ImageMap = new isRock.LineBot.ImagemapMessage( | |
new Uri("https://i.imgur.com/FIhYHDm.jpg"), //圖片位置 | |
new Uri("https://www.google.com")); //URL位置 | |
bot.PushMessage(UserId, ImageMap); |
This file contains 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
[HttpPost] | |
public IActionResult POST() | |
{ | |
//get configuration from appsettings.json | |
var token = _config.GetSection("LINE-Bot-Setting:channelAccessToken"); | |
var AdminUserId = _config.GetSection("LINE-Bot-Setting:adminUserID"); | |
var body = ""; //for JSON Body | |
//create vot instance | |
var bot = new isRock.LineBot.Bot(token.Value); | |
isRock.LineBot.MessageBase responseMsg = null; |
This file contains 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
connect-azAccount | |
#選定訂閱 | |
Select-AzContext -name "___換成你自己的訂閱名稱___" | |
Write-Output "-------------------" | |
#取得訂閱 | |
$sub=get-azcontext | |
#顯示訂閱名稱 | |
Write-Output "處理訂閱帳戶 --> " $sub.Name | |
#資源群組 | |
$ResourceGroup=Get-AzResourceGroup |
This file contains 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
var JwtSecurityToken = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(token.id_token); | |
var email = ""; | |
//如果有email | |
if (JwtSecurityToken.Claims.ToList().Find(c => c.Type == "email") != null) | |
email = JwtSecurityToken.Claims.First(c => c.Type == "email").Value; |
This file contains 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
//建立OAuth 身分驗證頁面並導入 | |
function AuthWithEmail() { | |
var URL = 'https://access.line.me/oauth2/v2.1/authorize?'; | |
URL += 'response_type=code'; | |
URL += '&client_id=這邊要換成你的client_id'; //TODO:這邊要換成你的client_id | |
URL += '&redirect_uri=http://localhost:17615/callback.aspx'; //TODO:要將此redirect url 填回你的 LineLogin後台設定 | |
URL += '&scope=openid%20profile%20email'; | |
URL += '&state=abcde'; | |
window.location.href = URL; | |
} |
This file contains 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
Install-Package Microsoft.ProjectOxford.Vision -Version 1.0.393 |
This file contains 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
//將Menu Item設為預設Menu | |
isRock.LineBot.Utility.SetDefaultRichMenu(menu.richMenuId, channelAccessToken); |
NewerOlder