在Rebol中刷新图像(Refresh an image in Rebol)
我一直在研究这个问题。 通过REBOL文档和答案在这里,但我很难过。 有人可以告诉我如何让REBOL GUI图像更新到另一个图像? 这是我经过两天黑客攻击后得到的代码。 任何帮助他都会赞赏。
REBOL [ Title: "Yvonne View" ] yvonne: func[] [ parts: probe parse read http://pics.mytrapster.com/yvonne.php {="} load to-string parts/6 ] img1: to-image (load-image yvonne) img2: to-image (load-image yvonne) v1: layout [ size 500x500 b: image img1 btn "Refresh" [ b: img2 ] btn "Quit" [quit] ] view v1
网址加载。 退出按钮有效。 “b”变量只是不清除和更新。
谢谢。
I've been working on this for a while. Gone through the REBOL docs and the answers here, but I am stumped. Can someone please tell me how to get an REBOL GUI image to update to another image? Here's the code I've gotten after two days of hacking at it. Any help would he appreciated.
REBOL [ Title: "Yvonne View" ] yvonne: func[] [ parts: probe parse read http://pics.mytrapster.com/yvonne.php {="} load to-string parts/6 ] img1: to-image (load-image yvonne) img2: to-image (load-image yvonne) v1: layout [ size 500x500 b: image img1 btn "Refresh" [ b: img2 ] btn "Quit" [quit] ] view v1
The url loads. The quit button works. The "b" variable just doesn't clear and update.
Thanks.
原文:https://stackoverflow.com/questions/26876518
最满意答案
总而言之,Powershell模块不能共享相同的上下文,您需要将凭证存储在VSTS中的secret变量中。
This is possible. Got it working today for my own VSTS extension that I released a while ago. My extension is using a
Azure Resource Manager endpoint
as input.Running it now on a Microsoft Hosted Visual Studio 2017 agent pool using the below code. See for more information my post on how to use AzureAD PowerShell cmdlets on VSTS agent.
Write-Verbose "Import AzureAD module because is not on default VSTS agent" $azureAdModulePath = $PSScriptRoot + "\AzureAD\2.0.1.16\AzureAD.psd1" Import-Module $azureAdModulePath # Workaround to use AzureAD in this task. Get an access token and call Connect-AzureAD $serviceNameInput = Get-VstsInput -Name ConnectedServiceNameSelector -Require $serviceName = Get-VstsInput -Name $serviceNameInput -Require $endPointRM = Get-VstsEndpoint -Name $serviceName -Require $clientId = $endPointRM.Auth.Parameters.ServicePrincipalId $clientSecret = $endPointRM.Auth.Parameters.ServicePrincipalKey $tenantId = $endPointRM.Auth.Parameters.TenantId $adTokenUrl = "https://login.microsoftonline.com/$tenantId/oauth2/token" $resource = "https://graph.windows.net/" $body = @{ grant_type = "client_credentials" client_id = $clientId client_secret = $clientSecret resource = $resource } $response = Invoke-RestMethod -Method 'Post' -Uri $adTokenUrl -ContentType "application/x-www-form-urlencoded" -Body $body $token = $response.access_token Write-Verbose "Login to AzureAD with same application as endpoint" Connect-AzureAD -AadAccessToken $token -AccountId $clientId -TenantId $tenantId
相关问答
更多-
关于构建任务扩展,您可以指定C#应用程序,例如控制台应用程序: "execution": { //"PowerShell3": { // "target": "Hello.ps1", // "argumentFormat": "" //} "Process": { "target": "..\\ConsoleApplication1.exe", "argumentFormat": "$(ConnectedServiceName) $(cur ...
-
最新版本的AzureRM模块(v5.3.0)包含新的cmdlet *-AzureRmAd* ,它们与*-AzureAd* cmdlet的作用相同。 因此,我需要更新我的脚本以使用这些新的cmdlet。 然后我不需要连接到AAD,只需要连接一次到ARM。 The latest version of the AzureRM module (v5.3.0) contains new cmdlets *-AzureRmAd* that appear to do the same thing as the *-Azu ...
-
您的问题是您在Release中使用Build变量。 这只是不起作用,它是空的,因为它在发布上下文中根本不存在。 即使你能做到这一点,我也不建议你这样做。 您的版本应仅依赖于工件,而不是在生成工件时构建变量。 您当然可以在工件中定义此变量,并从发布中进行访问,但我强烈建议您不要沿着这条路走下去,因为这是一个非常糟糕的做法。 你没有提到它,但如果你说为什么你认为你需要访问构建变量,也许我们可以帮助你在这里找到更好的解决方案。 Your problem is that you are using a Build ...
-
对于您的情况,您可以将AAD应用程序中的回复URL更改为
/signin-oidc 。 注意登录URL和注销URL设置中的基地址为http://localhost:port 。 此本地主机地址允许示例应用程序从本地系统不安全地运行。 端口是Kestrel服务器的默认端口。 如果您将应用程序配置为生产使用(如果您将应用程序发布到Azure Web App服务),请更新您的AAD应用程序中的回复URL。 例如, https://yourapp.azurewebsites.n ... -
不确定如何在PowerShell脚本中调用依赖项和应用程序。 但我尝试在PowerShell脚本任务中使用以下命令来运行Node.JS应用程序: invoke-expression 'cmd /c start powershell -Command {node main.js}' 在PowerShell脚本任务通过并完成后,应用程序将继续运行,该任务应满足您的要求。 有关详细信息,请参阅此问题: 新实例中的PowerShell启动脚本 。 但是您需要记住在测试完成后关闭该过程。 I am not sure ...
-
VSTS Build和PowerShell以及AzureAD身份验证(VSTS Build and PowerShell and AzureAD Authentication)[2022-06-24]
总而言之,Powershell模块不能共享相同的上下文,您需要将凭证存储在VSTS中的secret变量中。 This is possible. Got it working today for my own VSTS extension that I released a while ago. My extension is using a Azure Resource Manager endpoint as input. Running it now on a Microsoft Hosted Visua ... -
没关系,VSTS工作得很好,只是API在Azure上停止了,它返回相同的状态代码403,用于站点不可用和Forbidden 由于释放锁定以便能够发布应用程序的问题,因此在Azure上停止了API。 Nevermind, VSTS works just fine, only that the API was stopped on Azure and it returns the same status code 403 for Site not Available and for Forbidden The ...
-
您可以通过PowerShell调用REST API。 设定值( Put request): https://[vsts name].extmgmt.visualstudio.com/_apis/ExtensionManagement/InstalledExtensions/{publisherName}/{extension id}/Data/Scopes/User/Me/Collections/%24settings/Documents?api-version=3.1-preview.1 正文(内容类 ...
-
vsts-npm-auth无法在VSTS构建上获取身份验证令牌(vsts-npm-auth can't get authentication token on VSTS build)[2022-11-21]
该错误确实表明它无法获取凭据的原因: The prompt option is invalid because the process is not interactive. 这可能是由于构建代理程序未在交互模式下运行而导致无法提示凭据对话框。 如果您使用的是Hosted Build Agent,则构建代理将作为服务运行,并且无法更改为交互模式。 但是,此处的问题是,如果要在构建步骤中使用源,则在构建过程中提示凭据对话框没有意义,因为构建步骤无法自动输入所需的凭据。 不确定您的环境是否有任何特定要求,但一 ... -
按照设计 ,您必须通过PowerShell参数传递secret变量的值。 例如: 变量: password (secret) 任务: PowerShell 参数: -pass $(password) 脚本: Param( [String]$pass ) if ($pass) { Write-Host "variable is NOT null" } if (!$pass) { Write-Host "variable is null" } By design, you have to pass the ...