|
|
Hi shanthi,
You can find classes to work with Active Directory on System.Directory Services namespace. Please dig in to msdn which will help you do this.
If time allows i will create some working code to do this.
Neo
|
|
|
|
|
Hello,
How to get number of user accounts and there domain name in the machine
in C#.Net.
Thanks in advance.
Rahul Kulkarni
|
|
|
|
|
I am not sure if you have function to do this in .net how ever following WMI class will help you.
using System.Management;
.
.
.
public void GetOsDetails_Win32_Account()
{
ObjectQuery queryObject = new ObjectQuery("select * from Win32_Account");
ManagementObjectSearcher searchObj = new ManagementObjectSearcher(queryObject);
ManagementObjectCollection collection = searchObj.Get();
foreach(ManagementObject obj in collection)
{
Console.WriteLine("Caption:"+obj["Caption"]+
"\n"+"Domain:"+obj["Domain"]+
"\n"+"NAME:"+obj["Name"]+
"\n"+"LocalAccount ?:"+obj["LocalAccount"]+
"Status:"+obj["Status"]+"\n");
}
}
more values on this class are availe on
http://msdn2.microsoft.com/en-us/library/aa394061.aspx
Please let me know if it helps.
Neo
|
|
|
|
|
Thanks..
It is giving me all user's information of my pc as well as
all domain user also.
Can i get only admins of my pc?
Thanks in advance.
Rahul Kulkarni
|
|
|
|
|
Hi Rahul,
Please try changing the query in the earlier code ie
select * from Win32_Accounts to select * from Win32_Group where name = "Administrator".
This will provide you with all the users in the admin group.The class Win32_Group is a inherited from Win32_accounts.
I have not tested this code but theoretically it should do the purpose.
Please let me know if it works.
Neo
|
|
|
|
|
I have a set of forms I want to open them at the same position.
When I close a form and open another, it changes the position.
I tried using MDI forms too. But MDI parent form comes with a menu bar.
I dont require it.
What can I do?
Nana
|
|
|
|
|
Hi Nana,
If you want any form to appear in a specified location you can specify the same in the Form.Location property eiter in the design time or in the run time as
this.Location = new Point(x,y); In run time.
Let me know if it helps.
Neo
|
|
|
|
|
Thanks neo.
Giving at runtime, its working properly.
thanks once agian
Nana
|
|
|
|
|
How to translate numbers to a different language using c#.net
...............
|
|
|
|
|
Hi,
Rendering numbers to user interface is not managed by the .Net Framework but by the OS. So the number is displayed depending on regional settings.
HTH.
|
|
|
|
|
HI, all
i need help reg. datagridview of C# Windows Application.
please guide me(if possible with a sample), how to get values from an xml in to Datagridview of C#.net2.0WINDOWS APp
thnx in advance,
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
I am not sure But try creating one dataset and using datasets ReadXML method read the XML file you want. Set datasource as this dataset
|
|
|
|
|
Use this Sample.............
I have used DataCaching also in it..........
private void Page_Load(object sender, System.EventArgs e)
{
if(Cache["1"]==null)
{
FileStream fs = new FileStream(Server.MapPath("simple.xml"),FileMode.Open,FileAccess.Read);
CacheDependency cd=new CacheDependency(Server.MapPath("simple.xml"));
DataSet ds=new DataSet();
ds.ReadXml(fs);
DataView xmldata =new DataView(ds.Tables[0]);
Cache["1"]=xmldata;
Cache.Insert("1",xmldata,cd);
}
DataGrid1.DataSource=Cache["1"];
DataGrid1.DataBind();
// Put user code to initialize the page here
}
With Best Regards,
Yogesh
|
|
|
|
|
You may want to try this:
private void cmdGetTrades_Click(object sender, EventArgs e)
{
dsXML.Clear(); // should already be defined else define it here
// allowing user to select file else you can directly hard
// code the file name
openFileDialog1.Filter = "XML Files|*.xml";
openFileDialog1.Title = "Select SWAPs trades' XML file";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
dsXML.ReadXml(openFileDialog1.FileName);
grdTrades.AutoGenerateColumns = true;
grdTrades.DataSource = dsXML;
grdTrades.DataMember = "trade";
grdTrades.Sort(grdTrades.Columns["TradeID"], ListSortDirection.Ascending);
}
}
I am using this so it certainly works! Hope that helps you.
crzYank
|
|
|
|
|
thanx alot,
can u tell me How to retrive images to the same datagridview --[here too my backend storage is XML]
Thnx in advace
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
hi! i want to create a crystal report using stored procedure...
i am using vs 2003..
i want to pass a parameter..
i want one example for passing parameter to crystal report
|
|
|
|
|
You can fill a dataset using your SP and pass it to your app.
First learn about how to fill in a dataset using SPs.
And then, move towards learning how to pass this dataset and a parameter to your report.
|
|
|
|
|
Is there any way to link the active directory with .net . I need to achive this to avoid user creation both in .net and in Active dirctory. Please help me out.
Thank You,
A.Surenth.
|
|
|
|
|
Hi Surenth,
Please dig in to System.DirectoryServices name space in .Net.I will try to create some working code if time allows me today.
Neo
|
|
|
|
|
|
Hello everyone,
In my window application I have a ListView which is populated with the list of websites. I would like to be able to load these website once the item in the ListView is clicked. I have set everying reagarding the ListView but I have no clue how to load the website once the item is clicked.
Can someone be kind enough to tell me what code do I need to use for this? I have no clue what so ever for doing so. I have load at the linklable component, but that is not what I am looking for.
Thank you so much and have a great day.
Khoramdin
|
|
|
|
|
One possibility is to use the Process class.
using System.Diagnostics;
Process myProcess = new Process();
Process.Start("IExplore.exe", "www.codeproject.com");
Hope that helps.
Ben
|
|
|
|
|
Hello Ben,
thanx very much for all your help. you saved mt life, mate. There is one question which I have regarding the website loading. this is exactly what I need but this process opens the website in a New Explorer window. Is there any way I can open the website in a designated area in my window application?
thanx alot for your help and have a great day.
Khoramdin
|
|
|
|
|
There is a web broswer control that you can add to your form. If you are using .net 2.0 you can use the WebBrowser control.
private WebBrowser webBrowser1;
this.webBrowser1.Navigate("http://www.microsoft.com");
There is also a control in .net 1.1. Let me know if you are interested in that one.
Hope that helps.
Ben
|
|
|
|