Ir para conteúdo
Fórum Script Brasil
  • 0

Exibr Dados Do Registro Do Windows Em Html


melquirj

Pergunta

19 respostass a esta questão

Posts Recomendados

  • 0

o que eu quero fazer é o seguinte:

Estão querendo padronizar todas os pc's daqui da empresa, hj em dia eu uso o poledit para fazer isso, mas me pediram que eu fizesse um papel de parede padronizado que contesse o nome do usuario que esta logado e tambem o nome do pc, dai eu tive uma ideia, a unica maneira de fazer isso, claro que com menos trabalho, ´´e usando html, ou seja, o Active Desctop, dai eu preciso obter os dados do registro do windows.

Link para o comentário
Compartilhar em outros sites

  • 0

Mano.. acho que você não ta sabendo se expressar

você repetiu a mesma resposta em varios posts e ninguém entendeu.

Olha só gente.. o que ele quer, é que o NOME DO USUARIO LOGADO NO MICRO apareça automaticamente no papel de parede do windows.

Basicamente é isso ae.

Mano.. axo que com HTML num dá não..

Sei como fazer isso em ASP.. porém é preciso ter um servidor NT validando senhas e usuarios na rede..

E mesmo assim não sei se você vai conseguir isso aí..

Mas, em asp tem como pegar alguns dados desse gênero.

Porém, eu imagino que seja muito mais facil fazer isso com algum programa, desenvolvido em linguagens de software, como Delphi/VB.

Caso queira saber como faz em ASP, solicite ao moderador para mover para lá..

Senao, decida você mesmo o que deseja fazer!

Mas, o que você quer, é exatamente o que eu falei, né?

T+

Link para o comentário
Compartilhar em outros sites

  • 0

tá nome do usuario mas o que ele quer esse negocio do usuario que apareça no plano de fundo ou ele usou o terno ralatorio para se expressar o nome do usuario

qualquer coisa se você quiser que que eu redirecione para a ASP só falar

ate mais

Link para o comentário
Compartilhar em outros sites

  • 0

Bom Dia !!!

Agradeço a todos pela ajuda e me perdoem por não expressar a minha dificuladade corretamente, o que eu quero o dark0 reportou aqui.

A minha dificuldade maior é no win98 pois no xp eu posso criar um job que crie este html via variaveis de sistema, tipo %UserName% e %ComputerName%, mas o que eu queria é uma coisa mais dinamica, ou seja, que aparecesse automaticamente, pois da maneira que citei acima o processo ainda fica meio que manual.

Se alguém puder me enviar outras sujestões ficarei muito grato.

Link para o comentário
Compartilhar em outros sites

  • 0

Amigo, a maneira que eu citei não é a mais facil..

Pois, veja só:

O código ASP, que traria à tela os dados, seria bem simples, usaria 'variaveis do servidor', em asp.

Veja aqui uma listagem de dados que podem ser recuperados via código:

http://scriptbrasil.com.br/forum/index.php...indpost&p=90718

Porém, eu vejo como problema, o fato de você necessitar um Servidor Web instalado aí.. para o Código ASP rodar.

Se assim não servir, não sei se existe outra solução..

Se tiver duvidas com isso aí, poste no forum ASP, que a galera lá manja bem

Abraços

Link para o comentário
Compartilhar em outros sites

  • 0

Descobri uma forma de ler o registro do windows via " html ", segue abaixo as linhas de comandos, agora tenho que apenas exibir o dado que eu quiser.

Dá uma olhada nesse script.

<HEAD>

<TITLE>ActiveX Regedit sample - Registry viewer</TITLE>

<HTA:APPLICATION

ID="RegEdit"

APPLICATIONNAME="RegEdit"

CAPTION="yes"

ICON="regedit.ico"

SHOWINTASKBAR="yes"

SINGLEINSTANCE="no"

SYSMENU="yes"

SCROLLBAR="no"

>

<STYLE TYPE="text/css"><!--BODY {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }TH {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }TABLE {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }--></STYLE>

</head>

<STYLE TYPE="text/css"><!--BODY {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }TH {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }TABLE {font-size:10pt;font-family:Arial,Arial CE,Helvetica,sans-serif }--></STYLE>

</head>

<Body TOPMARGIN=0 BGPROPERTIES=FIXED BGCOLOR=WHITE LINK=RED VLINK=BLUE ALINK=GREEN>

This file is sample of using <A Href=http://www.pstruh.cz/help/regedit/library.htm>ActiveX Regedit</A>.

<HR Size=1 COLOR=Silver>

Connect to : <Input ID=RemoteServer><Input Type=Button Value="Connect" OnClick="do_Connect();">

<br>

<br>

<Table Border=0 CellPadding=0 CellSpacing=0>

<TR>

<TH VAlign=Top NoWrap>Registry keys<Div ID=ServerName>(Local)</Div></TH>

<TH Width=200><Font Size=1>Registry values<Div ID=KeyName>None</Div></Font></TH>

</TR>

<TR><TD VAlign=Top>

<Table Border=0 CellPadding=0 CellSpacing=0><TR><TD><DIV ID=Tree></Div></TD></TR></TABLE>

</TD><TD VAlign=Top>

<Table Border=0 CellPadding=0 CellSpacing=0><TR><TD><DIV ID=Vals></Div></TD></TR></TABLE>

</TD></TR>

</TABLE>

<HR Size=1 COLOR=Silver>

<FONT SIZE=-2>© 1998 – 1999 <a href=http://www.pstruh.cz>PSTRUH Software</a>, <a href=mailto:help@pstruh.cz>help@pstruh.cz</a></FONT>

</Body>

</html>

<script Language=VBSCRIPT ID=Main>

option explicit

Init

Sub Init()

'Writes root keys to the key tree.

Dim HTML

HTML = HTMLKeyCode("",Array("HKEY_CURRENT_USER", "HKEY_LOCAL_MACHINE", "HKEY_USERS","HKEY_CLASSES_ROOT"))

Tree.innerHTML = HTML

Vals.innerHTML = ""

KeyName.innerHTML = ""

End Sub

function do_Connect

'Connects to the remote computer registry.

dim Server

set Server = GetServer()

if Server Is Nothing then Exit Function

on error resume next

Server.Connect RemoteServer.value

'msgbox Err

if Err<>0 then

'on error goto 0

msgbox "Error connect registry, server '" & RemoteServer.value & "', " & Err.Description

exit function

ServerName.innerHTML = "(Local)"

end if

if RemoteServer.value="" then

ServerName.innerHTML = "(Local)"

else

ServerName.innerHTML = "(" & RemoteServer.value & ")"

end if

Init

end function

'Vals.document.write HTMLValueCode("HKCU\CONSOLE", GetServer().GetKey("HKLM\SOFTWARE").Values)

Function HTMLKeyCode(byval Parent, Keys)

'Writes one key as one-level HTML tree (one table)

Dim HTML, pHTML, Key, KeyText, numSubKeys, numValues, n, KeyName

HTML = "<Table Border=0 CellPadding=0 CellSpacing=0>" & vbCrLf

if Parent<>"" then Parent = Parent & "\"

numSubKeys = 1

numValues = 1

n = 0

For Each Key In Keys

n = n + 1

'Get mumber of subkeys and values of the subkey.

numValues=0

numSubKeys=1

if isobject(Key) then

on error resume next

numValues = Key.numValues

numSubKeys = Key.numSubKeys

if Err then

nOfSubKeys=0

numValues=0

end if

on error goto 0

end if

KeyText = Parent & Key

KeyName = KeyText

window.status = KeyText

pHTML = "<TR><TD VAlign=TOP>"

'Reference to subkeys

if numSubKeys>0 then

pHTML = pHTML & "<DIV ID=""X" & KeyName & """>"

pHTML = pHTML & "<A href=""#"" onclick=""return ExTree('" & replace(KeyText,"\","\\") & "');"">+</A>"

pHTML = pHTML & "</Div>"

end if

pHTML = pHTML & "</TD><TD> "

'Reference to values

if numValues>0 then pHTML = pHTML & "<A href=""#"" onclick=""return ExVal('" & replace(KeyText,"\","\\") & "');"">"

pHTML = pHTML & Key

if numValues>0 then pHTML = pHTML & "</A>"

if numSubKeys>0 or numValues>0 then pHTML = pHTML & "<Font Size=1> " & numSubKeys & "," & numValues & "</Font>"

'subkeys div to show subkeys.

pHTML = pHTML & "<DIV ID=""" & KeyName & """></Div>"

HTML = HTML & pHTML & "</TD></TR>" & vbCrLf

if n>100 then

HTML = HTML & pHTML & "<TR><TD></TD><TD>Truncated to 100 records</TD></TR>" & vbCrLf

exit for

end if

Next

HTML = HTML & "</Table>" & vbCrLf

HTMLKeyCode = HTML

End Function

Function HTMLValueCode(byval Parent, Keys)

'Writes values of one key as a table

Dim HTML, Key, KeyText, ValText

HTML = "<Table Border=1 CellPadding=0 CellSpacing=0>" & vbCrLf

If Parent <> "" Then Parent = Parent & "\"

HTML = HTML & "<TR><TH VAlign=TOP> Name </TH><TH> Value </TH></TH>" & vbCrLf

For Each Key In Keys

HTML = HTML & "<TR><TD VAlign=TOP> "

if Key.Name="" then HTML = HTML & "<i>DefaultValue</i>" else HTML = HTML & Key.Name

HTML = HTML & " <Font Size=1><I>("

select case Key.Type

case 1 : HTML = HTML & "String"

case 2 : HTML = HTML & "ExpandString"

case 3 : HTML = HTML & "Binary"

case 4 : HTML = HTML & "DWord"

case 7 : HTML = HTML & "MultiString"

end select

HTML = HTML & ")</I></Font>"

HTML = HTML & " </TD><TD> "

'name Link

on error resume next

ValText = "" & Key.Value

if err<>0 then ValText = "?"

ValText = replace(ValText, chr(0), "%00")

HTML = HTML & ValText

if Key.Type=4 then HTML = HTML & "(0x" & Hex(Key.Value) & ")"

on error goto 0

HTML = HTML & "</TD></TR>" & vbCrLf

Next

HTML = HTML & "</Table>" & vbCrLf

HTMLValueCode = HTML

End Function

function ExTree(KeyText)

'Expands one level of tree

ExTree = False

dim S, Key, HTML

set S = GetServer

if S Is Nothing then Exit Function

on error resume next

set Key = S.GetKey(KeyText)

if err<>0 then

msgbox "Error open key : " & KeyText & ", " & Err.Description

exit function

end if

on error goto 0

HTML = HTMLKeyCode(KeyText, Key.SubKeys)

Tree.all(KeyText).innerHTML = HTML

Tree.all(KeyText).style.display = ""

Tree.all("X" & KeyText ).innerHTML = "<A href=""#"" onclick=""return HideTree('" & replace(KeyText,"\","\\") & "');"">-</A>"

end function

function HideTree(KeyText)

'Hides one level of tree

Tree.all(KeyText).innerHTML = ""

Tree.all(KeyText).style.display = "none"

Tree.all("X" & KeyText ).innerHTML = "<A href=""#"" onclick=""return ExTree('" & replace(KeyText,"\","\\") & "');"">+</A>"

HideTree = False

end function

function ExVal(Co)

'Writes values from one key

ExVal = False

dim S, Key, HTML

set S = GetServer

if S Is Nothing then Exit Function

on error resume next

set Key = S.GetKey(Co)

if err<>0 then

msgbox "Error open key : " & KeyText & ", " & Err.Description

exit function

end if

on error goto 0

HTML = HTMLValueCode(Co, Key.Values)

Vals.innerHTML = HTML

KeyName.innerHTML = Co

end function

dim xServer

Function GetServer()

On Error Resume Next

Set GetServer = Nothing

If Not IsObject(xServer) Then

Set xServer = CreateObject("RegEdit.Server")

If Err = 429 Then

dim Res

Res = MsgBox("ActiveX RegEdit library is not installed. Do you want to download it from http://www.pstruh.cz now ?", 4, "ActiveX RegEdit")

If Res = 6 Then

dim newWindow

Set newWindow = window.open("http://www.pstruh.cz/dlldownload/regedit.exe")

End If

ElseIf Err<>0 then

MSGBox "Error create ActiveX Regedit object."

else

Set GetServer = xServer

End If

Else

Set GetServer = xServer

End If

On Error GoTo 0

End Function

</Script>

Tá meio zoneado, mas acho que dá para entender, qualquer duvida reporta.

Preciso muito da ajuda de vocês para tentar construir este projeto.

Link para o comentário
Compartilhar em outros sites

  • 0

amigo, porque postou 3 ou 4 vezes?

isso é flood..

EDITADO

Já arrumei

quanto ao melquirj, use o botao editar filho

Valeu Dark0 pelo toque! tongue.gif

Editado por Corposemalma
Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...