vbdotnet.it

Tricks & tips, workaround, forum and ideas with .Net

About the author

Enrico Rossini è il gestore di questo blog.
E-mail me Send mail

Recent posts

Recent comments

Contributi

Best 6 ~ 6 users ~ 6 comments

Info legali

Le opinioni espresse in questo blog sono strettamente personali e ogni persona è responsabile dei commenti che inserisce. I marchi citati sono delle rispettive aziende.

© Copyright 2010

Advertising


Come conoscere l'ID della scheda madre?

Questa funzione consente di conoscere l’identificativo del processore montato sul PC. Per poter eseguire correttamente questa funzione è necessario importare il namespace System.Management

   1:  Imports System.Management
   2:   
   3:  Public Function GetMotherBoardID() As String
   4:     Dim strMotherBoardID As String = String.Empty
   5:     Dim query As New SelectQuery("Win32_BaseBoard")
   6:     Dim search As New ManagementObjectSearcher(query)
   7:   
   8:     For Each info As ManagementObject In search.Get()
   9:        strMotherBoardID = info("SerialNumber").ToString()
  10:     Next
  11:   
  12:     Return strMotherBoardID
  13:  End Function

È possibile modificare questa funzione e trovare altre informazioni sul sistema.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Sunday, December 28, 2008 10:57 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Come conoscere l'ID del processore?

Questa funzione consente di conoscere l’identificativo del processore montato sul PC. Per poter eseguire correttamente questa funzione è necessario importare il namespace System.Management

   1:  Imports System.Management
   2:   
   3:  Public Function GetProcessorId() As String
   4:     Dim strProcessorId As String = String.Empty
   5:     Dim query As New SelectQuery("Win32_processor")
   6:     Dim search As New ManagementObjectSearcher(query)
   7:   
   8:     For Each info As ManagementObject In search.Get()
   9:        strProcessorId = info("processorId").ToString()
  10:     Next
  11:   
  12:     Return strProcessorId
  13:  End Function

Questa funzione può essere modificata per conoscere altre informazioni sulla macchina.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by enrico on Sunday, December 28, 2008 10:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Redirect con ScriptManager

È capitato anche a te che hai bisogno di eseguire un redirect da una pagina asp.net ma in questa c'è un controllo Ajax? Beh, a me capita e divento matto a trovare una soluzione per poter eseguire il redirect visto che il classic comanda server.redirect non funziona. Ecco qui due righine di codice che ti aiuteranno:

Dim script As String = ("window.location = '" + (redirectURL + "';"))
ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, True)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: asp.net
Posted by enrico on Wednesday, July 30, 2008 5:26 PM
Permalink | Comments (0) | Post RSSRSS comment feed