我目前正在开发一个Web应用程序,它位于iframe中以用于安全目的(保护用户数据)并托管在其他网站上.为了保持不安全数据的会话状态,我们将一些数据写入本地存储以获取用户功能,即记住用户的背景颜色,我们将"backgroundColour"保存为"红色".
但是我在iOS Safari上遇到了以下两个问题,目前可用于MacOS Safari和Chrome以及Internet Explorer 11.
问题1:当我强制退出iOS时,不保留本地存储
www.host.com该网站从不同的域加载我的iframe内容,www.example.com预期的行为:localStorage包含backgroundColour属性
实际行为:本地存储空
问题2:在不同站点上使用iframe内容不使用本地存储
www.host.com该网站从不同的域加载我的iframe内容,www.example.comwww.example.com预期行为:本地存储在不同站点之间保留,因为存储是针对iframe的DNS的
实际行为:本地存储空
有谁之前经历过这个吗?是否有人找到的解决方法?这是iOS Safari中的错误吗?我做错了什么吗?
干杯
我正在尝试将用于用户身份验证的MFA添加到AWS Cognito中用于设备管理的现有解决方案(内置于Angular中).
从用户体验的角度来看,我无法弄清楚如何很好地处理这个特定的响应.它实际上感觉很破碎,如果有其他人在这里经历过痛点,那就太爱了.
参见用例23.例如实现,我的如下:
authenticate(username: string, password: string): Observable<any> {
// init cognitoUser here
return new Observable((observer) => {
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess: (result: any) => {},
onFailure: (err: Error) => {},
mfaRequired: (codeDeliveryDetails: any) => {
// SMS has just been sent automatically
// and it needs to be confirmed within this scope
// The example linked requests the code via `confirm()`
// which is awful UX...and since this is a service
// probably non-compliant with best practice …Run Code Online (Sandbox Code Playgroud) 我试图在我的文档中找到一些只出现在“标题 1”样式中的文本。到目前为止,无济于事。
示例代码:
With ThisDocument.Range.Find
.Text = "The Heading"
.Style = "Heading 1" 'Does not work
.Execute
If .Found Then Debug.Print "Found"
End With
Run Code Online (Sandbox Code Playgroud)
请注意,它一直停在目录处。
编辑:修复了拼写错误的“if”语句
我创建了一个 Cognito 用户池,用户可以在其中注册但无法再登录。我尝试了许多不同的配置,例如禁用 MFA、关闭我所看到的可能导致此问题的设备记忆,但均无济于事。
最奇怪的是,这在本地工作正常 ( localhost:5000)。我可以在没有任何戏剧性的情况下创建帐户和登录,但是当我尝试登录我的网站https://example.com(托管在 S3 上)时,它会引发上述错误。如果我注册,用户实际上似乎也是在 Cognito 中创建的 - 这样就可以了,但是登录只是在本地以外的任何地方都不起作用。
我对每个设置、环境变量、重新创建用户池等进行了两次、三次检查。
错误
这是我尝试登录时抛出的模棱两可的错误:
{
__type: "NotAuthorizedException",
message: "Incorrect username or password."
}
Run Code Online (Sandbox Code Playgroud)
预注册触发的 lambda
我在用户通过 lambda 注册之前确认他们:
import {INTERNAL_SERVER_ERROR} from 'http-status-codes';
export async function validateHumanViaSns(
event: CognitoUserPoolTriggerEvent,
context: Context,
callback: Callback
): Promise<CognitoUserPoolTriggerHandler> {
try {
event.response.autoConfirmUser = true;
callback(null, event);
return;
} catch (error) {
console.error(error);
callback(null, new Response(INTERNAL_SERVER_ERROR, {message: 'Something went wrong'}));
return;
}
}
Run Code Online (Sandbox Code Playgroud)
包.json
我的客户正在使用最新的amplify-js库。
dependencies: …Run Code Online (Sandbox Code Playgroud) authentication amazon-web-services aws-cloudformation amazon-cognito aws-sdk
我正在使用一个公式来匹配两个工作表之间的多个列,并返回最后一个参考工作表最终列数据.我知道这在VBA中是可行的,但我正在寻找一种公式方法.
MainWorksheet:
User | Region | Country | City | Lookup
--------------------------------------------------
User1 | Europe | Italy | Rome | [formula here]
User2 | Americas | Brazil | Rio | [formula here]
Run Code Online (Sandbox Code Playgroud)
ReferenceWorksheet:
Region | Country | City | Data
-----------------------------------
Europe | England | London | some data
Americas | Brazil | Rio | more data
Europe | Italy | Rome | some more data
Run Code Online (Sandbox Code Playgroud)
我之后的公式应与该特定行中的每一列匹配,并将参考工作表中的数据单元格值添加到MainWorksheet中.
eg. If (MainWorksheet.Region = ReferenceWorksheet.Region) &&
(MainWorksheet.Country == ReferenceWorksheet.Country) &&
(MainWorksheet.Region == ReferenceWorksheet.Region) …Run Code Online (Sandbox Code Playgroud) 我有一个数据列表,比如存储在Excel工作表中的客户信息(名称,电子邮件,金额等).我的目标是单击Excel中的按钮,并将每个客户端的信息发送到Outlook模板中.
例如.亲爱的<<客户名>> =亲爱的约翰史密斯
我的代码到目前为止:
Dim myOlApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItemFromTemplate("C:\egTemplate.oft")
With MyItem
.To = Worksheets("Clients").Range(1, 2)
.Subject = "Monthly bill"
'Refer to and fill in variable items in template
.Save
End With
Set MyItem = Nothing
Set MyOlApp = Nothing
Run Code Online (Sandbox Code Playgroud)
我需要知道这是否可能,我可以在没有插件的情况下完成吗?如果有的话,是否有人知道我可以遵循的良好链接/教程?
在此先感谢您的亲切问候
更新添加了我的代码并对请求进行了一些更改
我的服务器上有一个存储过程,它插入一些参数并返回插入的参数ID.我正在写一个表单来轻松完成这个,但我似乎无法获得传回的参数.
为了节省你做一大堆可能毫无意义的阅读,最好只关注我的C#代码,让我知道我需要做什么才能传递参数并得到一个回报.
C#Default.aspx
connection = new SqlConnection(ConfigurationManager.AppSettings["ConnectionInfo"]);
sql = "aStoredProc";
command = new SqlCommand(sql, connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameter.Add(new SqlParameter("@FirstName", SqlDbType.VarChar)).Value = sFirstname;
command.Parameter.Add(new SqlParameter("@SurName", SqlDbType.VarChar)).Value = sSurname;
connection.Open();
int ID = command.ExecuteNonQuery();
connection.Close();
Run Code Online (Sandbox Code Playgroud)
SQL aStoredProc
IF EXISTS(SELECT * FROM aTable WHERE ID = @ID)
-- User exists, update details
BEGIN
BEGIN TRAN
UPDATE aTable
SET
FirstName = @FirstName,
SurName = @SurName,
LastUpdate = GetDate()
WHERE ID = @ID
IF (@@Error != 0)
ROLLBACK TRAN
ELSE
COMMIT TRAN …Run Code Online (Sandbox Code Playgroud) 我有一些代码可以创建一个邮件对象(Outlook),附加一个文件并发送它。
Dim mobjOutlook, mobjActiveExp, mobjNewMail As Object
'Create Outlook objects
Set mobjOutlook = CreateObject("Outlook.Application")
Set mobjActiveExp = mobjOutlook.ActiveExplorer
Set mobjNewMail = mobjOutlook.CreateItem(olMailItem)
'Setup and send email
With mobjNewMail
.To = "someone@test.com"
.Subject = "theSubject"
.Body = "some text"
.Attachments.Add "C:/The/File/Path.doc"
'*I need to check here if the above line worked*
.Send
End With
Run Code Online (Sandbox Code Playgroud)
如何在发送前测试附件是否有效?这可能吗?出于某种原因,即使没有,它仍然会发送没有附件的电子邮件。
我正在考虑以某种方式使用 '.Save' 选项。
非常感谢任何想法或建议,谢谢。
Travis默认安装Firefox 31.0esr,但我们希望始终使用最新版本.这里的引用说它应该是非常直接的,但它似乎并没有实际安装,而是它似乎只是下载tar文件.量角器在运行时仍然使用Firefox版本31.0esr.
travis.yml
addons:
firefox: "latest"
Run Code Online (Sandbox Code Playgroud)
protractor.conf.js
capabilities: {
'browserName': 'firefox'
}
Run Code Online (Sandbox Code Playgroud)
日志:
最初的Firefox安装仍然发生:
[34m[1mInstalled Firefox version[0m
firefox 31.0esr
Run Code Online (Sandbox Code Playgroud)
...该addon部分开始before_install并按预期在该部分之前下载文件:
[0Ktravis_fold:start:install_firefox
[0K$ export FIREFOX_SOURCE_URL='https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64'
[33;1mInstalling Firefox latest[0m
travis_time:start:0dff0345
[0K$ wget -O /tmp/firefox-latest.tar.bz2 $FIREFOX_SOURCE_URL
--2016-01-04 23:29:18-- https://download.mozilla.org/?product=firefox-latest&lang=en-US&os=linux64
Resolving download.mozilla.org (download.mozilla.org)... 52.20.26.65
Connecting to download.mozilla.org (download.mozilla.org)|52.20.26.65|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://download.cdn.mozilla.net/pub/firefox/releases/43.0.3/linux-x86_64/en-US/firefox-43.0.3.tar.bz2 [following]
--2016-01-04 23:29:18-- http://download.cdn.mozilla.net/pub/firefox/releases/43.0.3/linux-x86_64/en-US/firefox-43.0.3.tar.bz2
Resolving download.cdn.mozilla.net (download.cdn.mozilla.net)... 23.0.160.35, 23.0.160.65
Connecting to download.cdn.mozilla.net (download.cdn.mozilla.net)|23.0.160.35|:80... connected.
HTTP request sent, awaiting response... 200 …Run Code Online (Sandbox Code Playgroud) 禁止表单在刷新时重新提交的最佳方法是什么?!IsPostBack不处理刷新.我尝试使用bool变量在初始提交时设置为true,但是每次加载页面时它似乎都会重置.
我已经阅读了一些关于cookie的内容,但我不确定如何设置它们以便在页面之间传递.
我的设置是:
我是否像在SessionState中那样在web.config中设置cookie?有什么比饼干更好用吗?
我有一长串文件,它们都以“yyyyMMdd”格式的日期结尾,需要将它们更改为“MMM-yy”。解决这个问题的最佳方法是什么?
例如“file_one_20120620.pdf”>“file_one_JUN-12.pdf”
Joey 在下面建议了一个 Powershell 脚本,看起来它应该可以工作,但我一直在撞墙,即使在更改提供的代码时也是如此。任何帮助都会很棒,谢谢!
vba ×3
c# ×2
excel ×2
javascript ×2
outlook ×2
asp.net ×1
aws-cognito ×1
aws-sdk ×1
cookies ×1
date ×1
filenames ×1
firefox ×1
forms ×1
iframe ×1
ios ×1
ms-access ×1
ms-word ×1
multi-factor ×1
outlook-vba ×1
parameters ×1
powershell ×1
protractor ×1
regex ×1
safari ×1
sdk ×1
sql ×1
travis-ci ×1