如何以编程方式确定 Flash 存储本地共享对象的位置
我正在为 Flash 电影编写一些自动验收测试(使用 iMacros 驱动电影)。
我需要在每次测试运行之前通过清除闪存存储在本地共享对象中的设置来“重置”测试环境。
我可以通过删除以下位置的文件来手动执行此操作:
C:\Documents and Settings{username}\Application Data\Macromedia\Flash Player#SharedObjects\FQSTGCV7\{site-url}
显然我想自动执行此删除步骤; 但我想知道如何以非机器特定的方式确定上述路径。
在 .NET 中,
“C:\Documents and Settings{用户名}\Application Data\Macromedia\Flash Player#SharedObjects\”显然是
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
@"Macromedia\Flash Player\#SharedObjects")
如何确定“FQSTGCV7”在不同计算机上的位置? 有环境变量吗? #SharedObjects\ 下面是否只有 1 个目录?
谢谢
I'm writing some automated acceptance tests for a flash movie (driving the movie using iMacros).
I need to "reset" the test environment before each test run by clearing out the settings flash is storing in Local Shared Objects.
I can do this manually by deleting the files in:
C:\Documents and Settings{username}\Application Data\Macromedia\Flash Player#SharedObjects\FQSTGCV7\{site-url}
Obviously I want to automate this deletion step; but I'm wondering how to determine the above path in a non machine specific way.
In .NET,
"C:\Documents and Settings{username}\Application Data\Macromedia\Flash Player#SharedObjects\" is clearly
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
@"Macromedia\Flash Player\#SharedObjects")
How do I figure out what "FQSTGCV7" will be on a different machine? Is there an environment variable? Is there only ever 1 directory below #SharedObjects\ ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定这一系列字符是如何确定的,但事实上它总是以 site-url 结尾,这让我相信简单的正则表达式/字符串匹配应该能够为您完成这项工作。 只需查找以您网站的 URL 结尾的文件即可。
此外,只需将空数据推送到 LSO 即可使 Flash 影片刷新其自己的数据。 此外,通过进入 Flash 播放器的设置菜单,您可以将 LSO 所需的空间量调低至 0,关闭设置,然后重新打开设置并将其调回到默认值,从而刷新所有数据10万。 这些可能都不适合您的情况,但它们确实派上用场。
I'm not sure how that series of characters are determined, however the fact that it always ends with the site-url leads me to believe a simple bit of regex/string matching should be able to do the job for you. Just look for a file that ends in your site's URL.
In addition, it is possible to make a Flash movie flush it's own data by simply pushing empty data to the LSO. Also, by going into the settings menu of the Flash player you can flush all of the data by dialing the desired amount of space for LSOs down to 0, closing the settings, and then re-opening settings and dialing it back up to the default 100k. Neither of these may be applicable in your case, but they do come in handy.
寻求同一问题的答案:
“我如何知道“FQSTGCV7”在不同的机器上是什么”?
注意:如果您清除该文件夹并重新启动,它似乎会生成一个新的“随机代码”。
我将其称为 FlashRuntime 键。
任何有关计算此值的见解将不胜感激。
我检查了注册表,但找不到它。
最坏的情况是,我可能会实时创建一个 LSO,并查看它写入的内容。
Seeking to find the answer to the same question:
"How do I figure out what "FQSTGCV7" will be on a different machine"?
Note: If you wipe out that folder and reboot it appears to generate a new "random code".
I am referring to it as the FlashRuntime key.
Any insight on to figuring out this value would be appreciated.
I checked the registry and couldn't find it there.
Worst case, I might create an LSO in realtime, and see what it was written to.