Ho creato un applicazione che mi deve leggere il seriale dell'hd, in locale funziona, mentre spostando i file sul server mi va in errore
Questo e l'errore:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
Questo e il codice:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Management" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\ "");
PropertyData diskProperty = disk.Properties["VolumeSerialNumber"];
string seriale_hd = diskProperty.Value.ToString();
Response.Write(seriale_hd);
}
</script>
Chi mi aiuta a capire come posso risolvere il problema?


Rispondi quotando
Vi prego aiutatemi.
