|
You forgot to mention the 'Preview' button when you post a new topic or a reply.
It shows you what your post will look like allowing an oportunity to make changes and correct mistakes/formatting before posting to the forum.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
i'm trying to take specific values from xml file into my CheckedListBox but i couldn't make it plz help me
I want to take all the properties(of <tabular>) which have attribut edit = "true" in to my Checkedlistbox
here is my xml file
lasers
laser id="Laser1"
properties
gauge
property name="Output1" min="0" max="100" optimalval="50" currval="0"/property
property name="Output2" min="0" max="100" optimalval="50" currval="0"/property
property name="Output3" min="0" max="100" optimalval="50" currval="0">
<property name="Output5" min="0" max="100" optimalval="50" currval="0">
<property name="Output6" min="0" max="100" optimalval="50" currval="0">
tabular
property name="temperature1" currval="12" edit="true" selected="true" min ="0" max ="100"/property
property name="temperature2" currval="56" edit="false" selected="false" min ="0" max ="100"/property
property name="temperature3" currval="36" edit="true" selected="false" min ="0" max ="100"/property
property name="temperature4" currval="67" edit="false" selected="false" min ="0" max ="100"/property
<property name="temperature5" currval="37" edit="true" selected="true" min="0" max="100">
<property name="temperature6" currval="87" edit="true" selected="true" min="0" max="100">
<property name="temperature7" currval="89" edit="false" selected="false" min="0" max="100">
<property name="temperature8" currval="23" edit="true" selected="false" min="0" max="100">
<property name="temperature9" currval="78" edit="false" selected="false" min="0" max="100">
property name="Avg OutPut" currval="81" edit="true" selected="true" min ="0" max ="100"/property
/tabular
/properties
/laser
-----------
and after this my req is i need to catch the selected values and i wanna desply in a form-----------------this is my req and
i am helpless here, plz try to help me
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
how to draw listbox items with different itemheight when i select a item?
the example pictures at
http://goldli.s75.53dns.com/2.jpg
http://goldli.s75.53dns.com/1.jpg
I know that use MeasureItem and DrawItem Method to draw,but i can only draw same height items.
|
|
|
|
|
Check this out explains and demonstrates the func. you are looking for.
http://www.codeproject.com/useritems/ExtendedListBoxControl.asp
Hope it helps.
Mike
Started out with nothing and still have most of it left!
|
|
|
|
|
Hi friends,
I am facing a PROBLEM WHILE I send mails with the SMTP class of System.Net.Mail.
The code shows below.
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("from@domain.com");
mail.To.Add("to@domain.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("mysmtpserver.net");
//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new System.Net.NetworkCredential("user@domain.com", "password");
smtp.Send(mail);
I have a valid smtp server name, username and password. I configured it to outlook and working fine. And wen I test it using telnet port 25 then also its working.
I upload the file to my hosting space. I have two hosting account with godaddy.
The mailing script is working fine in one hosting account. That hosting account have SSL and dedicated IP address.
But the mailing code is not working in the other hosting account. That hosting account is Windows hosting + ASP.NET 2.0 supported.
The error I am getting is as shown as below.
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
Please help me on this issue....
Thanks in advance....
JIJO BABY - Lets Play C#
|
|
|
|
|
Some hosting plans disable any outgoing network traffic from the website, except HTTP. You should make sure that is not the case with your account.
|
|
|
|
|
Hi
I want to have a MS-WORD template and which should be taken as a input to the C# application. I will have some template variables in that template (.dot ) file those should be replaced during run time by the C# object. Please give some sample to work around this.
Thanks.
|
|
|
|
|
Hello everyone,
I am trying to find all methods that have a particular signature. In other words, I want all methods that match the return type and parameter types of a specified method. I have a solution, but I was wondering if a more elegant approach exists. Using delegates is one possibility, but delegates are not very “edit-and-continue” friendly.
Here is my current solution:
void findSimilarMethods()
{
MethodInfo example = this.GetType().GetMethod("ExampleMethod");
ParameterInfo[] parameters = example.GetParameters();
List<MethodInfo> matches = new List<MethodInfo>();
MethodInfo[] methods = this.GetType().GetMethods();
foreach (MethodInfo current in methods) {
ParameterInfo[] currentParams = current.GetParameters();
if ( current.ReturnType != example.ReturnType )
continue;
if ( currentParams.Length != parameters.Length )
continue;
if ( !ParameterEquality(parameters, currentParams) )
continue;
matches.Add(current);
}
}
bool ParameterEquality(ParameterInfo[] a, ParameterInfo[] b)
{
if (a.Length != b.Length)
return false;
for (int i = 0; i < a.Length; i++)
if (a[i].GetType() != b[i].GetType())
return false;
return true;
}
Any suggestions would be greatly appreciated.
-Steve
|
|
|
|
|
Why not use one of the other overloads of GetMethod MSDN[^], like the one that takes the method name and a Type [] for the parameters?
And you don't really need to match return type if you're matching parameter types, because you can't overload methods based on return type alone.
|
|
|
|
|
Why is it that I can declare a constructor in a parent class as protected and then inherent that class and declare a constructor as public in the child class? However if I declare the parent's constructor as private I am unable to create any constructor at all in the child class. Why?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
It has to do with the accessibility rules in C# and the meanings of private, protected, and public methods.
From the C# Language Reference[^]
- The intuitive meaning of public is "access not limited".
- The intuitive meaning of protected is "access limited to the containing class or types derived from the containing class".
- The intuitive meaning of private is "access limited to the containing type".
When a type or member M is accessed, if M is protected, the access is permitted if it occurs within the class in which M is declared, or if it occurs within a class derived from the class in which M is declared and takes place through the derived class type (Section 3.5.3).
Otherwise, if M is private, the access is permitted if it occurs within the type in which M is declared.
As described in Section 3.4, all members of a base class, except for instance constructors, destructors and static constructors, are inherited by derived types. This includes even private members of a base class. However, the accessibility domain of a private member includes only the program text of the type in which the member is declared.
So, by declaring the constructor as "private", you are limiting it's accessibility to the class in which it is declared (the "containing type"). This effectively tells the compiler that since there is no default constructor accessible from outside the class, any derived classes cannot create an instance of their base class and, therefor, cannot themselves contain constructors.
By declaring the constructor as "protected", you are limiting it's accessibility to the class in which it is declared (the "containing type") and also to any types derived from that class. This effectively tells the compiler that the child classes are able to create an instance of their base class, and, therefor, can also contain constructors.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
The private constructor is intended:
- for classes that doesn't need to be created (provides only static methods)
- for implementing the singleton pattern
Also check out the constructor usage guidelines [^]
Anyway why would you derive a class with private constructor and instantiate that?
|
|
|
|
|
Zoltan Balazs wrote: Anyway why would you derive a class with private constructor and instantiate that?
I wouldn't, at least I can't see any situation where I would need to do that right now. I just want to try to understand every nook and cranny of the C# language and the CLR. Sometimes I get a very simple question stuck in my head and I am not satisfied until I figure it out. A lot of times these questions have to do with object-oriented concepts.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Well, any constructor you create in the child class will call the base class constructor - and fail because you've declared it as private. It's just like some external class attempting to instantiate and therefore call the private constructor.
If you're not clear why a derived class's constructor must call a base class one, take a look at this example
class Base
{
public int x;
public Base() { x = 20; }
}
class Derived : Base
{
public Derived() {}
}
Now if you run the following snippet of code
Derived d = new Derived();
Console.WriteLine(d.x);
What value do you expect? 20, because Derived after all, is a Base. If Derived's constructor did not call the Base one, then the above snippet will give x's default value instead.
|
|
|
|
|
Are you saying that the C# compiler implicitly calls the base's constructor? I thought you had to explicitly do that.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Captain See Sharp wrote: Are you saying that the C# compiler implicitly calls the base's constructor?
Yes, it attempts to call the base class's default constructor, if you don't make an explicit call. That's why you'll see code like this fail to compile
class Base
{
public Base(int x){}
}
class Derived : Base
{
public Derived() {}
}
|
|
|
|
|
S. Senthil Kumar wrote: That's why you'll see code like this fail to compile
I see, I thought C# always created a default parameterless constructor, I tested it and you are right, it does not compile.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
It will always create a default parameterless public constructor unless you define your own constructor(s). That's why when you want to create a purely static class, you explicitly define a private constructor (typically parameterless)...that way you avoid having a default public constructor and therefore your class has no accesible constructors at all. If you dont explicitly add this private constructor your class would automatically have the default public one and consumers would be able to instantiate it.
And yes, any derived class constructor will attempt to call the default constructor of it's base class if no other constructor of said base class is explicitly called in your code.
|
|
|
|
|
Another question. The child class only implicitly calls the base's parameterless constructor right? If it does this, will it call the parent's parameterless constructor for all of the child's constructors if you do not explicitly call a specific base constructor?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Captain See Sharp wrote: will it call the parent's parameterless constructor for all of the child's constructors if you do not explicitly call a specific base constructor?
Yes, it will.
|
|
|
|
|
what is mean of state management...
where we r using.....
which purpose.....
please give me detailed...
|
|
|
|
|
State Management is used in ASP.NET 2.0. It provides a variety of mechanisms for building stateful Web applications. This module introduces view state, application cache, session state, profiles, and cookies.
|
|
|
|
|
I have a user control inherited from a Panel. I'm trying to make it re sizable and movable(mostly done)
I'd like to add a property to be able to lock the width or height or both.
I'm not sure how to do it. The code below kind of gives the feeling of what I'm trying to do.
Once again, my thanks goes out to this great board and its members.
<br />
<br />
public partial class PanelSizable : System.Windows.Forms.Panel<br />
{<br />
<br />
enum LockedType<br />
{<br />
Both,<br />
Width,<br />
Height,<br />
None<br />
};<br />
<br />
<br />
<br />
private LockedType lockStatus = LockedType.None;<br />
<br />
public LockedType LockSize<br />
{<br />
get { return lockStatus; }<br />
set { lockStatus = value; }<br />
<br />
}<br />
<br />
....<br />
|
|
|
|
|
Ok, when you set the lock type the set method will execute, that should be known already.;P In the set method record the size of your control. Now make sure you have registered all resize events for the control (there are at least 3), when one of those events gets fired due to a resize of the control, set the size back to the locked values. The control will then "snap back". In case more than one resize event gets executed during a resize make sure that you pay attention which events get fired and attempt to reduce duplicate "snap backs" to improve performance.
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
Hello every body
I'm working in my garduation project that is Iris Recgonition
My Supervisor recomened me the steps that i have to works on it
1-convert image to grayScale
2-apply smoothing filter
3-apply an edge detection algorithm( canny or sobel )
4-find pupil and iris using hough transform
thes is the first stage of my project
now i have already do the first & second & third steps
i need ur help in implementing a hough trnasform to find pupil and iris
i tried to study it for a long time but i really failed to understand the consept
please help me ...
|
|
|
|