Silverlight 不提示增加配额
我正在尝试 Silverlight 的独立存储功能。 当前通过 ASP.NET 页面运行 Silverlight。
我已经编写了一些代码来请求额外的存储,但系统没有提示我添加更多存储。
private void requestButton_Click(object sender, RoutedEventArgs e)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.AvailableFreeSpace >= 1000*1024) return;
long usedSpace = store.Quota - store.AvailableFreeSpace;
if (store.IncreaseQuotaTo(usedSpace + 1000*1024))
statusTextBlock.Text =
string.Format("Quota has been increased to {0}", store.Quota);
else
statusTextBlock.Text =
"You have denied quota increase... you Inglorious Basterd...";
}
}
Silverlight 的 Application Storage
选项卡确实列出了托管 Silverlight 的本地主机 ASP.NET 页面,如下所示。
根据截图,http://localhost:54389
有1.0MB 可用存储空间。localhost
网站上是否设置了忽略提示的限制?
Silverlight 提示用户增加配额所需的步骤是什么?
I am trying out Silverlight's Isolated Storage feature.
Currently running Silverlight thru ASP.NET page.
I have written some code to request an additional storage but I am not being prompted to add more.
private void requestButton_Click(object sender, RoutedEventArgs e)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.AvailableFreeSpace >= 1000*1024) return;
long usedSpace = store.Quota - store.AvailableFreeSpace;
if (store.IncreaseQuotaTo(usedSpace + 1000*1024))
statusTextBlock.Text =
string.Format("Quota has been increased to {0}", store.Quota);
else
statusTextBlock.Text =
"You have denied quota increase... you Inglorious Basterd...";
}
}
Silverlight's Application Storage
tab doeslist the localhost ASP.NET page hosting Silverlight as shown below.
According to the screenshot, http://localhost:54389
has 1.0MB of available storage area.
Is there a restriction set on localhost
websites that a prompt is ignored?
What are the required steps for Silverlight to prompt users to increase quota?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许这看起来有点简单,但您的屏幕截图显示 localhost:54389 当前使用的空间是 0.0MB。因此,
AvailableFreeSpace
将为 1.0 MB(当前配额的大小)。现在您的代码中有这一行:-在此基础上,我希望您的代码此时返回。
Perhaps this might seem a bit simplistic but your screen shot shows that the current space used by localhost:54389 is 0.0MB. Hence the
AvailableFreeSpace
will be 1.0 MB (the size of the current quota). Now your code has this line in it:-On that basis I would expect your code return at this point.