ASP.Net网络应用程序和注册表 [英] ASP.Net web app and the registry

查看:77
本文介绍了ASP.Net网络应用程序和注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从网页

申请访问注册表是否有限制?


以下代码适用于Windows应用程序,但来自我的网络应用程序

在尝试打开密钥时给出错误对象引用未设置为对象的实例




Dim strKey As String =" Software\Microsoft\Internet

Explorer \ PageSetup"

Dim oKey As RegistryKey = Registry.CurrentUser.OpenSubKey(strKey)

Dim s As String = oKey.GetValue(" header","")

oKey.Close()


但是这段代码可以在网络应用程序中使用:


Dim strKey As String =" Software \ MicroSoft \ Windows NT \ currentVersion"

Dim oKey As RegistryKey = Registry.LocalMachine.OpenSubKey(strKey)

Dim s As String = oKey.GetValue(" ProductID","")

oKey.Close ()


我可以给我们b app打开并修改密钥的权利?


-

Ray Greene

Are there restrictions on accessing the registry from a web
application?

The following code works from a Windows app but from my web app it
gives the error "Object reference not set to an instance of an object"
when it tries to open the key.

Dim strKey As String = "Software\Microsoft\Internet
Explorer\PageSetup"
Dim oKey As RegistryKey = Registry.CurrentUser.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("header", "")
oKey.Close()

However this code works from the web app:

Dim strKey As String = "Software\Microsoft\Windows NT\currentVersion"
Dim oKey As RegistryKey = Registry.LocalMachine.OpenSubKey(strKey)
Dim s As String = oKey.GetValue("ProductID", "")
oKey.Close()

Can I give the web app rights to open and modify the key?

--
Ray Greene

推荐答案

Ray,


我不确定你问这个。


你永远不会(以标准的方式)来在

用户的注册表中有一个网页。


如果您不将它用作富客户端,限制可以使用它的用户

你自己的独家新闻。


Cor
Ray,

I am not sure of you ask this.

You never (in a standard way) can come with a webpage at the registry of the
user.

If you not use it as a rich client which limits the users who can use it to
your own scoop.

Cor


2005年12月7日星期三06:52:38 + 0100,Cor Ligthert [MVP]

< no ************ @ planet.nl>写道:
On Wed, 7 Dec 2005 06:52:38 +0100, "Cor Ligthert [MVP]"
<no************@planet.nl> wrote:
Ray,

我不确定你问这个。

你从来没有(以标准的方式)可以在
用户的注册表中附带一个网页。

如果您不将它用作富客户端,限制可以使用它的用户使用自己的勺子。
Ray,

I am not sure of you ask this.

You never (in a standard way) can come with a webpage at the registry of the
user.

If you not use it as a rich client which limits the users who can use it to
your own scoop.




好​​的,我想要做的是在打印前以编程方式设置IE的打印设置

。有没有办法从网上申请

申请?


-

Ray Greene



OK, what I was trying to do was set up IE''s print settings
programatically before printing. Is there a way to do this from a web
application?

--
Ray Greene


Ray Greene写道:
Ray Greene wrote:
好的,我试图做的是在打印前以编程方式设置IE的打印设置。有没有办法从网页
应用程序执行此操作?
OK, what I was trying to do was set up IE''s print settings
programatically before printing. Is there a way to do this from a web
application?




否。可能有一些CSS设置可用于@ page在一个

" @media print"部分。有些浏览器甚至可能不会忽略它们。


Andrew



No. There may be some CSS settings that you can use with "@page" in a
"@media print" section. And some browsers might even not ignore them.

Andrew


这篇关于ASP.Net网络应用程序和注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆