|
hi,
how can i count child nodes in xml file.
|
|
|
|
|
Hi there,
let the xDoc is a XmlDocument of your xml file,
then you can simply get the child count ;
xDoc.ChildNodes.Count;
|
|
|
|
|
hi
iam getting child node value is 0
what i should do
plz give one example code .
Hi,
Thanks, if u think it's good.
otherwise sorry.
|
|
|
|
|
child node VALUE, didnt you ask the number of nodes,
value is somehow different thing.
|
|
|
|
|
Hi,
I am working in the project to list all hardware device and block the accessing (disable) in both windows and MS-Dos.please give ideas for this
Gnanas
|
|
|
|
|
Hi,
I dont know in c# but I have done this in vc++ to block cd drives .
If you want ,reply me I will send you the code.
May be you can Inport that API in c# programme to do your work
<marquee>nishu
|
|
|
|
|
will you please send that code to me??
|
|
|
|
|
Hi,
May be this will help you.
#include<windows.h>
#include<winioctl.h>
void main()
{
HANDLE h;
h=CreateFile("\\\\.\\E:",GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
DWORD r;
PREVENT_MEDIA_REMOVAL pmr;
pmr.PreventMediaRemoval=false;//here do true or false//
DeviceIoControl(h,IOCTL_STORAGE_MEDIA_REMOVAL,(void*)&pmr,sizeof(pmr),NULL,NULL,&r,NULL);
CloseHandle(h);
}
Use this code to implement yours
<maarquee>nishu
|
|
|
|
|
Include following header files
windows.h
winioctl.h
<marquee>nishu
|
|
|
|
|
Greetings all,
I'd like to retrieve all windows users, actually the user list
when the xp os starts, the user list seen in the screen.
I mean I dont want to list the hidden users like; ASPNET, HelpAssistant, SQLDebugger ...
I just want to gather a list that user who logon.
like, John, Mary, ...
I currently user tthe following code, but it retrieve all users, inculding hidden ones.
//--------------------------------------------------------------------------------
DataTable dtKullanicilar = new DataTable();
DataColumn dcAd = new DataColumn("Kullanici", typeof(string));
dtKullanicilar.Columns.Add(dcAd);
ManagementClass usersClass = new ManagementClass("Win32_UserAccount");
ManagementObjectCollection users = usersClass.GetInstances();
foreach (ManagementObject user in users)
{
DataRow dru = dtKullanicilar.NewRow();
dru["Kullanici"] = Convert.ToString(user["Name"]);
dtKullanicilar.Rows.Add(dru);
}
//--------------------------------------------------------------------------------
Thank you all ...
|
|
|
|
|
Hi,
Hey do this man!!!!
Environment.OSVersion.Platform
Environment.UserName
This will help you!!!!
<marquee>nishu
|
|
|
|
|
Thank you,
but I want to retireeve all users, not the current user
|
|
|
|
|
I developed a chat application.When i send a lengthy text or an emoticons then it shows an exception
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
Additional information: End of Stream encountered before parsing was completed.
below is my code of recieving data
------------------------------------------------------------------------------
public void XOnMessageRecieving(IAsyncResult ar)
{
try
{
ClsPacket stObj = (ClsPacket) ar.AsyncState; // restore state object..
if (stObj == null)
{
return; // if any of the remote end has been disposed then... finish futher processing..
}
int bytesRecieved = stObj.Soket.EndReceive(ar); // end the asynchronous call and get number of bytes recieved..
if (bytesRecieved < stObj.Bufer.Length) // if number of bytes recieverd are less than the buffer length ... i.e. 32
{
stObj.ContextBuffer.Write(stObj.Bufer,0,bytesRecieved);//put last bytes recieved...
stObj.ContextBuffer.Seek(0,0); //put reference to the begining of memory stream..
stObj.ContextBuffer.Position=0;
BinaryFormatter bFormatter = new BinaryFormatter(); //set up a formatter to deserialize object form memory stream...
try
{
EvtArgCCI cciArg = (EvtArgCCI) bFormatter.Deserialize(stObj.ContextBuffer); // decerialize object and get it as EvtArgCCI object..
ClsCCI.XFireCCIMessageEvent(cciArg); // send this information to other managers through CCI to take proper actions..
}
catch(Exception ex)
{
//here comes the exception "End of stream encountered before parsing was compeleted."
}
stObj.ContextBuffer = new MemoryStream(); // clear the memory stream.. for other message...
}
else
{
stObj.ContextBuffer.Write(stObj.Bufer,0,bytesRecieved); // keep storing the message into state object untill whole message/packet is read...
}
try
{
stObj.Soket.BeginReceive(stObj.Bufer,0,stObj.Bufer.Length,SocketFlags.None,new AsyncCallback(XOnMessageRecieving),stObj); // create an asynchrounous hook to continue recieving packets....
}
catch(Exception ex)
{
}
}
catch(Exception ex)
{
}
}
Adeel
|
|
|
|
|
hi all ,
i have a byte array where the data is represented as hexadecimal number.
I want to retrive this hexadecimal number from the byte.
then again i need to convert the hexadecimal number to float.
plz help me and give me some suggestions..
thanks in advance,
Sunita
|
|
|
|
|
Hi,
Frankly speaking I never tried this but I can suggest you something to try out.
try this,
System.Int32.Parse("your hex number",System.Globalization.NumberStyles.AllowHexSpecifier);
or
float.Parse(,System.Globalization.NumberStyles.AllowHexSpecifier);
May be this will help you.
Reply me.
<marquee>nishu
|
|
|
|
|
|
Hi
i am working on MDI in which i have multiple forms. I want that whenever a new form is opened, already opened forms get closed. Can anybody tell me how can i do that?
sAqIb
|
|
|
|
|
if u r using MDI form to open other forms from it
then use following codes before the codes u r using to open new
form
foreach(Form ftr in this.MdiChildren)
{
if(ftr!=null)
ftr.Close();
}
rahul
|
|
|
|
|
its working.
thanks
sAqIb
|
|
|
|
|
Ya Rahul is right.
Do that way only.
<marquee>nishu
|
|
|
|
|
all,
We are using office automation to convert excel and word to htm we had severa issues like access denied exception etc. and for this issue to solve we followed KB article of MS to configure office under specific user account, but the problem is because security issues we cant follow KB article(http://support.microsoft.com/kb/288367/), by looking at KB article what i felt is they are trying to create a profile for local administrator user. So my question can any body have any alternate for this??
We accept tht we went for bad design, but we dont have any other alternative as this is a must requirement from customer.
Please any cluse any information you have.
|
|
|
|
|
Hi,
I wonder where you got the exception. Are you using Visual Studio Tools for Office 2003? Or are you using normal plugins to automate office?
If you use Visual Studio Tools for Office you have to setup code access security policies to work with the addons. This can be done under any account, by running caspol under administrative privileges
WM.
Yaaarrrr
What about weapons of mass-construction?
|
|
|
|
|
Hi everyone, I was asked following question, if anyone knows can u pls tell me
1. The assembly has been updated from version 1.0 to 2.0. The latest assembly 2.0 has some problem, it is required that application should use old assembly. How can we make the application to use old versioned assembly dynamically?
2. while developing a web application what factors should be considered with respect to no of ppl access the same application at a time?
3. When a http request is received by IIS serever, it checks if the page is .aspx and passes to aspnet_is.dll engine. How IIS server detects aspx page? if I have a .html page, and I change the file extension to .aspx, will this page process by IIS server to aspnet_is.dll?
Thanks and regards
|
|
|
|
|
Job interview? Doesn't the fact that you're asking the CodeProject forums give away you might be cheating a bit? Here are my guesses.
1. With enormous difficulty unless there's something I don't know. There's no way to unload an assembly, you have to unload the AppDomain to which it has been loaded, so unless you've really planned for this, you can't unload version 1.0 and load in 2.0. To do that you'd need multiple domains in your app and have a Marshalling nightmare between them all. By design, you could load the assembly in at startup and use reflection to access it, but again you would have had to have planned for this in the design. Anybody know a way of doing this without reflection and I'd be very interested to hear how.
2. Scalability issues. Things like session expiry, caching and the like. Also speed of hardware/farming options etc.
3. IIS knows because you ask for a page with an .aspx extension. In IIS you can tell which ISAPI extensions to use for each file type. If you change an .html page to end with .aspx, then it will get passed to the asp.net ISAPI dll and handled by .net (probably very badly).
Regards,
Rob Philpott.
|
|
|
|
|
If i have a string that contains certain delimiters, such as a comma(','), then how can I get a count of it.
consider the string as
"one, two, three, four". the number of commas in this example is 3. How can I get it using C#?
Would really appreciate help.
Keshav V. Kamat
Systems Engineer
Siemens
India.
|
|
|
|