|
How to get motherboardID, Harddisk ID and processor ID in C#.net?
Soumya Mathew
|
|
|
|
|
This is the ASP.NET forum, you can't do that in ASP.NET. The management class lets you do it in C#, however.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You need WMI Programming For that.
This is the sample code for retrive processor ID
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
{
public class MyWMIQuery
{
public static void Main()
{
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_Processor");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("ProcessorId: {0}", queryObj["ProcessorId"]);
}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred");
}
}
}
}
For MotherBoard use the following Query
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_MotherboardDevice");
and this Print Motherboard ID
Console.WriteLine("DeviceID: {0}", queryObj["DeviceID"]);
Hope this will helps you !!!!
|
|
|
|
|
Already i posted the same question later but u didnt reply.please help me i want it urgently
function ChkDelete(Value)
{
var ValChecked=Value.checked;
var ValID=Value.id;
var form=document.forms[0];
for(i=0;i<form.length;i++)
{
if(this!=null)
{
if (ValID.indexOf('CheckAll') != - 1)
{
if (ValChecked)
form.elements[i].checked = true;
else
form.elements[i].checked = false;
// alert('hai');
}
else if(ValID.indexOf('Delete')!=-1)
{
if(form.elements[i].checked==false)
form.elements[1].checked=false;
}
}
}
}
Hello Good Morning Everybody.
I put a grid view in a page ang put checkboxes in it to delete the particular row in grid.Also i put a checkall checkbox in the header template of grid.The javascript code for checking all the checkboxes are attached above.
My issue is ,also i insert a checkbox list in the same page below the gridview.When i click the checkall checkbox in the grid the chckbox list also will be checked and unchecked.For single selection its not a pbm.But for checking all its a big pbm .How i solve it.Please help me.Is any changes in the above code will cancel the effect of checking the checkboxlist.or any otehr javascript code will help it.Please help me.
|
|
|
|
|
Actually i am not getting you properly.
Your means U have a checkbox in header and one for each row.when u checked
on header check box u want to be checked all.U did that ,but when u individally click on all the check box in front of rows,u want header check box is also checked.
I am right.Or anything u want.
|
|
|
|
|
Not like that That part is cleared .But the pbm is i have a checkbox list in the same page where the grid is available.When i click on the checkall checkbox in the header of grid the checkboxlist is also checked.How i stop it..
|
|
|
|
|
I have two webconfig files in my project.One on root and second one
is on Subfolder.Presenly i am in subfolder ,how can i access the webconfig
of root..
Please suggest
Regards,
Neeraj Jain
|
|
|
|
|
How do you mean 'access' ? Any settings in the one above that are not overridden are visible in the subfolder, aren't they ?
'
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
some where in internet, when user selects wrong option a flasy alert gets displayed with the background page greyed out and user must chose an option so as to activate the background page. how do i do that in asp.net?
thanks in advance.
|
|
|
|
|
The absolute easiest way is to install the ASP.NET AJAX library, which has a control to do that.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
uglyeyes wrote: some where in internet, when user selects wrong option a flasy alert gets displayed with the background page greyed out and user must chose an option so as to activate the background page.
They use JavaScript to do that. Microsoft Ajax control toolkit has those controls. But if you/your client is not interested in using that you can try generic javascript to achieve it.
1. Create a div element.
2. Set its width and height 100%.
3. Set its background color to grey or whatever color you want. You can also set opacity.
4. Then on the every show it and after choosing the option hide it.
Sounds simple right... But implementation would complex. If you embed the above as a JavaScript class then it would be great.
|
|
|
|
|
Use Ajax for that.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Is that possible? I mean, I have this project written in ASP, and it does some common tasks (log in, etc) and then it calls some pages in ASP.NET. In particular, the ASP page saves the logged user into the Session object. Now I'm trying to access it from the ASP.NET page, but Session.Count is returning a big round zero. What I'm up to, is it possible to do? If not, how can I do it?
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
To do something like this, you need an intermediate object, probably a windows service, in to which you can stuff the asp session and then pull it out again on the ASP.NET side.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Mmm... I see. I guess I could send a QueryString from the ASP into an ASPX and in such, I will add it to the Session object. That would be alright, wouldn't it?
Thanks!
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Yes, so long as the data is not secure, that is going to work just fine.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Chris,
Sorry for interrupting...
You said that we an use Windows Service for share the Session objects. What kind of Windows Service? Is it a in-built one or we have to write a one?
|
|
|
|
|
There's nothing built in. I wrote one for an ASP.NET 1.0 page, a long time ago. I'd be surprised if google didn't turn any up, it wasn't that complex.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Writing Windows Service and running it would be fine if we own the Web Server. What about the person who deploys in shared web servers.
|
|
|
|
|
After logon in the Master page, am showing tree node using the following.
if (HttpContext.Current.User.IsInRole("abc"))
{ Show tree node }
This works fine.
I have a Impersonate.aspx page where I make the user enter the user id on the textbox and associate it with Global.asax.cs I have this.
public static string CurrentUser
{
get
{
if (_currUser == string.Empty)
return SignedOnUser;
else
return _currUser;
}
set { _currUser = value; }
}
I have to get the CurrentUser value when I use HttpContext.Current.User.IsInRole()
Am I taking the right approach? Please help.
Thanks
|
|
|
|
|
Hi,
I really need help
I have a page designed in ASP.net over VB
it is an evaluation form :
20 questions for each there must be five choices (excellent, veryGood, Good, week, bad)
the questions are stored in the database (SQL)and retrieved once the page loaded, I had added 5 radio buttons to the gridview as template Item
AS FOLLOWS:
<asp:templatefield headertext="ansewrs">
<itemstyle width="230px">
<itemtemplate>
<asp:radiobutton id="btn5" runat="server" groupname="answer">Text="excellent" />
<asp:radiobutton id="btn4" runat="server" groupname="answer">Text="veryGood" />
<asp:radiobutton id="btn3" runat="server" groupname="answer">Text="good" />
<asp:radiobutton id="btn2" runat="server" groupname="answer">Text="week" />
<asp:radiobutton id="btn1" runat="server" groupname="answer">Text="bad" />
But how can I retrieve the answers of each question when a button is clicked
I really need to know and I will do any thing
another ideas are accepted
There is always something to learn
modified on Thursday, December 20, 2007 4:01:01 PM
|
|
|
|
|
|
thaaaaaaaaaaaank u very much it helped
There is always something to learn
|
|
|
|
|
Hello everybody,
I should create an application through wich a user could schedule the execution of an asp page. I'm tryng to understand how to schedule jobs in Windows Scheduled Tasks, using an asp script.
I'm using Windows 2003 SP1 and IIS 6.0
At first I had tried to use WScript.Shell and run
schtasks /create /tn prova /tr 'pagina.asp' " & _
"/sc once /st 09:55:00 /sd 23/11/2007 /ru username /rp password
but I couldn't go on because of permissions' lack.
Suddenly I've tried to use WbemScripting.SWbemLocator in this way:
1. Set Locator = Server.CreateObject("WbemScripting.SWbemLocator")
2. Locator.security_.impersonationLevel = 3
3. Set wmiNameSpace = Locator.ConnectServer (computername, "root\cimv2", username, password)
4. Set Wcls = Service.Get("Win32_ScheduledJob")
Doing this, I received a Denied Access message on type bar 3
Then I've tried to use this:
1. strComputer = "."
2. Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
3. Set objNewJob = objWMIService.Get("Win32_ScheduledJob")
But I get a Denied Access message on type bar 2
I would like to know if is the right way to create and schedule jobs, and how could I solve this problem
I apologize for my english.
Thanks
|
|
|
|
|
rspadar wrote: I received a Denied Access message
Well that should give you a clue. You shouldn't attempt to do this from a webbrowser. Why would you want to allow users to schedule tasks on your server? Where are the username and password coming from?
only two letters away from being an asset
|
|
|
|