如何使用Delphi从正在运行的Chrome实例中获取网址?
我正在尝试使用Delphi应用程序来获取浏览器的活动选项卡的URL(IE,Mozilla等).我正在使用适用于IE的代码:
procedure TForm1.GetCurrentURL (var URL, Title : string);
var
DDEClient : TDDEClientConv;
s : string;
begin
s := '';
try
DDEClient := TDDEClientConv.Create(self);
with DDEClient do
begin
if SetLink('IExplore','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle')
else
if SetLink('Netscape','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle')
else
if SetLink('Mosaic','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle')
else
if SetLink('Netscp6','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle')
else
if SetLink('Mozilla','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle')
else
if SetLink('Firefox','WWW_GetWindowInfo') then
s := RequestData('0xFFFFFFFF,sURL,sTitle');
end;
if s <> '' then
begin
delete(s,1,1);
URL := copy(s,1,pos('","',s)-1); …Run Code Online (Sandbox Code Playgroud) 我们正在开发一个使用 Google 电子表格作为输入的程序。电子表格的值被读取、处理,结果显示在网页中。
当用户注册时,我们使用服务帐户从模板克隆电子表格。该模板有一些我们想用来帮助用户在电子表格中引入值的脚本。
但是脚本似乎拥有服务帐户的所有者,并且根据 Google 属于服务帐户的脚本无法执行。
错误信息是:
Google Apps 脚本:无法运行脚本,因为它归服务帐户所有。请在运行前将项目复制或转移到有效帐户。
我们将电子表格的所有权从服务帐户转移给了 gmail 用户,如果该用户创建了一个脚本,它可以完美运行,但从模板继承的脚本似乎仍然拥有服务帐户的所有者,因此无法执行。
我的问题是......我如何将项目(脚本)的所有权从服务帐户转移到另一个用户?
我用谷歌搜索并在开发者谷歌电子表格网站上搜索,但找不到答案
google-sheets google-apps-script google-drive-api google-cloud-iam
我在Android应用程序中使用Gson将复杂对象转换为JSON表示.其中一个字段是名为QuickPin的字符串,其中包含加密密码,字符"="由Gson转换为"\ 003d".
Json字符串由C#WEBAPI应用程序使用,但返回"发生错误"消息.
以下JSON返回该错误消息:
{"UserContractID":"929c1399-11c4-490e-8cff-5b1458ac18e2","UserAuthentication":"MethodCombo":{"AuthMethod":[1]},"QuickPin":"mW2n2uTECEtVqWA2B9MzvQ\u003d\u003d"},"CustomerID":0,"OriginID":0,"OriginTypeID":0,"Status":0}
Run Code Online (Sandbox Code Playgroud)
同时这个JSON工作得很好:
{"UserContractID":"929c1399-11c4-490e-8cff-5b1458ac18e2","UserAuthentication":{"QuickPin":"mW2n2uTECEtVqWA2B9MzvQ==","MethodCombo":{"AuthMethod":[1]}},"CustomerID":0,"OriginID":0,"OriginTypeID":0,"Status":0}
Run Code Online (Sandbox Code Playgroud)
有没有办法强制Gson用密码维护字符串= =(以及其他情况如果)字符?
我的Android代码是:
Gson gson = new Gson();
user = new User();
user.UserAuthentication = new UserAuthentication();
user.UserAuthentication.QuickPin = "mW2n2uTECEtVqWA2B9MzvQ==";
user.UserAuthentication.MethodCombo = new MethodCombo();
user.UserAuthentication.MethodCombo.AuthMethod = new ArrayList<Integer>();
user.UserAuthentication.MethodCombo.AuthMethod.add(1);
user.Status = 0;
String jsonRepresentation = gson.toJson(user);
object.put("user", jsonRepresentation);
Run Code Online (Sandbox Code Playgroud)
谢谢