|
But how about numericUpDown control?
|
|
|
|
|
It must have a textbox in it, the trick is working out how to access it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
In a other word as your mean, numericUpDown control can't finish this function?
|
|
|
|
|
No, I mean the numeric control obviously contains a textbox, if there's one there. So, you need to find out how to get access to it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I want to get the USB & Serial COM Port entries in system.
I got only the Communication Serial COM Port entries.
Im using the following Codes.
System.Management.ManagementClass mClass = new System.Management.ManagementClass("Win32_SerialPort");
System.Management.ManagementObjectCollection mObjCol = mClass.GetInstances();
foreach (ManagementObject port in mObjCol)
{
cmbPortNo.Items.Add(port["deviceid"]);
cmbPortNo.Text=cmbPortNo.Items[0].ToString();
}
if(cmbPortNo.Items.Count.ToString()=="0")
{
MessageBox.Show("No serial port available...");
}
In this how can i get the USB COM Port in this method...
|
|
|
|
|
Hello all,
I have an ftp application that transfers files between two servers.
I need to use SMTP to do the file transfer now.
How can i do this using .Net and C#?
Please help.
Thanks in anticipation
|
|
|
|
|
in my application i can drag and drop folders and files.......
problem is:
if i drag and drop a folder which has no access writes... how can i differentiate tht folder from a normal folder.
Directory.Exists is giving me true for both the case... I am getting this
System.UnauthorizedAccessException.
is thr any property which differentiates between these folders.
|
|
|
|
|
Use public DirectorySecurity GetAccessControl ()
for eg;
using System;
using System.IO;
using System.Security.AccessControl;
namespace FileSystemExample
{
class DirectoryExample
{
public static void Main()
{
try
{
string DirectoryName = "TestDirectory";
Console.WriteLine("Adding access control entry for " + DirectoryName);
// Add the access control entry to the directory.
AddDirectorySecurity(DirectoryName, @"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow);
Console.WriteLine("Removing access control entry from " + DirectoryName);
// Remove the access control entry from the directory.
RemoveDirectorySecurity(DirectoryName, @"MYDOMAIN\MyAccount", FileSystemRights.ReadData, AccessControlType.Allow);
Console.WriteLine("Done.");
}
catch (Exception e)
{
Console.WriteLine(e);
}
Console.ReadLine();
}
// Adds an ACL entry on the specified directory for the specified account.
public static void AddDirectorySecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
// Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
// Add the FileSystemAccessRule to the security settings.
dSecurity.AddAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
// Set the new access settings.
dInfo.SetAccessControl(dSecurity);
}
// Removes an ACL entry on the specified directory for the specified account.
public static void RemoveDirectorySecurity(string FileName, string Account, FileSystemRights Rights, AccessControlType ControlType)
{
// Create a new DirectoryInfo object.
DirectoryInfo dInfo = new DirectoryInfo(FileName);
// Get a DirectorySecurity object that represents the
// current security settings.
DirectorySecurity dSecurity = dInfo.GetAccessControl();
// Add the FileSystemAccessRule to the security settings.
dSecurity.RemoveAccessRule(new FileSystemAccessRule(Account,
Rights,
ControlType));
// Set the new access settings.
dInfo.SetAccessControl(dSecurity);
}
}
}
I hope this will help you
<marquee>nishu
|
|
|
|
|
How to get information about Mp3 tag (title, artist ...)?
|
|
|
|
|
V1 tags are free text on the end of the file. V2 tags are compressed. There's some free code on the web that reads both, WMP and DirectShow will also do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have not worked with Consoles before but I am trying now.
I have an app that when you type in "setproxy none" it disables the proxy. When you type "setproxy testproxy:80" it enables the proxy.
How would I execute these commands when pressing a button?
Thanks!
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
You don't have a button, it's a console app. But if you mean how does a windows app call a console app, Process.Start.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Call me stupid. What do you mean by Process.Start? I want to be able to execute some line of code from a windows app.
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
If you build a console app, you can run it with Process.Start. Isn't that what you want to do ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Maybe you want to create a windows application and handel the click event... and just place the source code from your console application into that event handler.
|
|
|
|
|
Hi! All
I have to deploy my Asp.Net, C# application using Weblogic as the application server, is it possible? If yes, please explain a little bit.
I have to use web services in my application. Its my client requirement, they don’t want to use IIS, but instead they will be using the Weblogic as the application server.
Thanks in advance for your cooperation.
keep smilling.....
|
|
|
|
|
|
Thaks for response Graus.
keep smilling.....b'coz smile is the shortest distance between people....
|
|
|
|
|
hi,
i want to read one particular Xml_node in c#.net
how can i read that node
plz give sample code for that .
in the below xml file i want read <phone_no> node only
and that phone_no child nodes text is stored in listbox.
/*
<<deatails>
<<names>
<<name1>a
<<name2>b
<<name3>c
<
<<phone_no>
<<no1>9898776
<<no2>8272679
<<no3>7t8124748
<
<
<<add1>gsdghgkef
<<add2>guiqweu3r
<<add3>io34uiiju
<
<
*/
Thanks
-- modified at 2:07 Wednesday 13th September, 2006
|
|
|
|
|
Hi,
To read the XML file or string you can use the XmlDocument class which is in the System.XML namespace.
XmlDocument doc = new XmlDocument();
doc.Load("xmlstring");
doc.LoadXML("xmlfile");
XmlNode root = doc.DocumentElement;
XmlNodeList list = root.ChildNodes;
foreach(XmlNode node in list)
{
if(node.HasChildNodes)
{
XmlNodeList list1 = node.ChildNodes;
foreach(....)
{
}
}
else
{
string name=node.Name;
string text=node.InnerText;
}
}
Hope this code helps you.
Do your best to be the best
|
|
|
|
|
You would use XmlDocument, but you'd use XPath to go direct to your node, as in
foreach(XmlNode node in doc.SelectNodes("//deatails/phone_no/No"))
And to do this, you'd fix your schema and replace No1, No2 and No3 with nodes that all have the same name ( and a number as an attribute if you need it for number, but the order will never change anyhow ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi ,
thanks for giving helpful idea.
i try that but in, i can't get the data of node
plz check my code give any modifications.
iam new to c#.net and xml
private void button1_Click(object sender, System.EventArgs e)
{
string filename = "C:\\C#program\\cs_programs\\singlenode\\bin\\Debug\\nodexml.xml";
XmlTextReader tr = new XmlTextReader(filename);
XmlDocument doc = new XmlDocument();
while(tr.Read())
{
foreach(XmlNode node in doc.SelectNodes("//details/add/addr"))
listBox1.Items.Add(doc.Value);
}
}
|
|
|
|
|
Like I said, your schema is useless. You need to change the addr1/addr2/addr3 nodes to all be just addr. And don't forget, XML is case sensitive.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi Christian
i new to c#.net
i want to access one node in xmlfile using c#.net .
that node have child node (i want that child node values)
i write my xml file like this
<
<<name>
<<n>Ap
<<n>MP
<<n>UP
<
<<add <<addr1="">gjsefgjkl<<addr2>dfhtyxcvd<<addr3>ioiopweri
<
in this i want to access the "add" child node value.
i wrote c#.net code like this,
"When i press Button the childnode("add") values r stored in listbox "
plz change any modification in my code or plz give code how to access thatnode
private void button1_Click(object sender, System.EventArgs e)
{
string filename = "C:\\C#program\\cs_programs\\singlenode\\bin\\Debug\\nodexml.xml";
XmlTextReader tr = new XmlTextReader(filename);
XmlDocument doc = new XmlDocument();
while(tr.Read())
{
foreach(XmlNode node in doc.SelectNodes("//details/add/addr"))
listBox1.Items.Add(tr.Value);
}
}
Thanks
|
|
|
|
|
Well, if you want to access the add node, just drop the rest of the XPath - /details/add
If you want to get all the addr nodes, name them all addr, as I advised you to do in the first place.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|