Click here to Skip to main content
15,881,709 members
Home / Discussions / C#
   

C#

 
AnswerRe: sql c# connection for sign_in Pin
padmanabhan N26-Jun-09 18:55
padmanabhan N26-Jun-09 18:55 
GeneralRe: sql c# connection for sign_in Pin
Christian Graus26-Jun-09 20:21
protectorChristian Graus26-Jun-09 20:21 
GeneralRe: sql c# connection for sign_in Pin
padmanabhan N26-Jun-09 20:41
padmanabhan N26-Jun-09 20:41 
GeneralRe: sql c# connection for sign_in Pin
A_A26-Jun-09 23:29
A_A26-Jun-09 23:29 
GeneralRe: sql c# connection for sign_in Pin
padmanabhan N26-Jun-09 23:40
padmanabhan N26-Jun-09 23:40 
GeneralRe: sql c# connection for sign_in Pin
A_A27-Jun-09 3:17
A_A27-Jun-09 3:17 
QuestionHow to get DiskDrive model if I know the Drive letter Pin
lexx_zone26-Jun-09 10:40
lexx_zone26-Jun-09 10:40 
AnswerRe: How to get DiskDrive model if I know the Drive letter Pin
I Believe In GOD26-Jun-09 13:44
I Believe In GOD26-Jun-09 13:44 
Hello

Hope this help ...
I know it's far a bit from your answer ...
But I really tried to help you as much as I can ,,


1)
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
namespace ConsoleApplication31
{
    class Program
    {
        static void Main(string[] args)
        {
            ManagementScope scope = new ManagementScope(@"\root\cimv2");
            ObjectQuery query = new ObjectQuery("select * from Win32_DiskPartition");
            ManagementObjectSearcher searcher = new
            ManagementObjectSearcher(scope, query);
            ManagementObjectCollection drives = searcher.Get();
            foreach (ManagementObject current in drives)
            {
                Console.WriteLine("device id = " + current["deviceid"]);
                ObjectQuery associators = new ObjectQuery("ASSOCIATORS OF {Win32_DiskPartition.DeviceID=\"" + current["deviceid"] + "\"} where assocclass=Win32_LogicalDiskToPartition");
                searcher = new ManagementObjectSearcher(scope, associators);
                ManagementObjectCollection disks = searcher.Get();
                foreach (ManagementObject disk in disks)
                {
                    Console.WriteLine("\tdevice id = " + disk["deviceid"]);
                }
            }
        }
    }
}


2) Another Example ...
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;
namespace ConsoleApplication31
{
    class Program
    {
        static void Main(string[] args)
        {

            ManagementScope scope = new ManagementScope(@"\root\cimv2");
            ObjectQuery query = new ObjectQuery("select * from Win32_DiskPartition");
            ManagementObjectSearcher searcher = new
            ManagementObjectSearcher(scope, query);
            ManagementObjectCollection drives = searcher.Get();
            int dindex= 0;
            foreach (ManagementObject current in drives)
            {
                dindex = int.Parse(current["DiskIndex"].ToString());
            }
            scope = new ManagementScope(@"\root\cimv2");
            query = new ObjectQuery("select * from Win32_DiskDrive WHERE Index = " + dindex.ToString());
            searcher = new
            ManagementObjectSearcher(scope, query);
            drives = searcher.Get();
            foreach (ManagementObject current in drives)
            {
                Console.WriteLine(current["Model"].ToString());
            }
        }
    }
}


I know nothing , I know nothing ...

GeneralRe: How to get DiskDrive model if I know the Drive letter Pin
lexx_zone27-Jun-09 1:05
lexx_zone27-Jun-09 1:05 
GeneralRe: How to get DiskDrive model if I know the Drive letter Pin
padmanabhan N27-Jun-09 1:14
padmanabhan N27-Jun-09 1:14 
QuestionArbitrary length bitfields? Pin
Trollslayer26-Jun-09 10:32
mentorTrollslayer26-Jun-09 10:32 
AnswerRe: Arbitrary length bitfields? Pin
Luc Pattyn26-Jun-09 11:01
sitebuilderLuc Pattyn26-Jun-09 11:01 
GeneralRe: Arbitrary length bitfields? Pin
Trollslayer26-Jun-09 11:04
mentorTrollslayer26-Jun-09 11:04 
QuestionDistribute a sql-based solution Pin
saeidfarahi26-Jun-09 10:09
saeidfarahi26-Jun-09 10:09 
AnswerCross post Pin
Not Active26-Jun-09 10:55
mentorNot Active26-Jun-09 10:55 
AnswerRe: Distribute a sql-based solution Pin
I Believe In GOD26-Jun-09 13:03
I Believe In GOD26-Jun-09 13:03 
GeneralRe: Distribute a sql-based solution Pin
saeidfarahi26-Jun-09 23:31
saeidfarahi26-Jun-09 23:31 
QuestionGoing back to original IF statement if another one returns false Pin
Baeltazor26-Jun-09 9:43
Baeltazor26-Jun-09 9:43 
AnswerRe: Going back to original IF statement if another one returns false Pin
Luc Pattyn26-Jun-09 9:49
sitebuilderLuc Pattyn26-Jun-09 9:49 
AnswerRe: Going back to original IF statement if another one returns false Pin
Christian Graus26-Jun-09 9:56
protectorChristian Graus26-Jun-09 9:56 
AnswerGoing back to original IF statement if another one returns false Pin
PunkIsNotDead26-Jun-09 10:03
PunkIsNotDead26-Jun-09 10:03 
QuestionHelp with DataGridViewComboBoxColumn... Pin
PunkIsNotDead26-Jun-09 9:40
PunkIsNotDead26-Jun-09 9:40 
QuestionGroupbox/panel border problems Pin
Dan Neely26-Jun-09 8:34
Dan Neely26-Jun-09 8:34 
AnswerRe: Groupbox/panel border problems Pin
Luc Pattyn26-Jun-09 9:44
sitebuilderLuc Pattyn26-Jun-09 9:44 
GeneralRe: Groupbox/panel border problems Pin
Dan Neely26-Jun-09 10:05
Dan Neely26-Jun-09 10:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.