|
I have a https page and i need to click the 'Save' (it is a graphical button ),want to automate from c#
|
|
|
|
|
|
I m already doing it with internet explorer ,i ve alredy done what u told me to do ,kindly provide me with the chunk of code for graphical button ,thank u
|
|
|
|
|
I'm sorry but I can't "provide" you with something I do not have. Keep trying and I'm sure you'll find the answer.
Good luck!
|
|
|
|
|
what are generic in c#
Ashwani
|
|
|
|
|
its a new feature in c#2.0
Ashwani
|
|
|
|
|
it avoids object type casting
Ashwani
|
|
|
|
|
Whats this ? question is yours and replies are also from your side
Take a look
Generics are classes, structures, interfaces, and methods that have placeholders (type parameters) for one or more of the types they store or use. A generic collection class might use a type parameter as a placeholder for the type of objects it stores; the type parameters appear as the types of its fields, and the parameter types of its methods. A generic method might use its type parameter as the type of its return value, or as the type of one of its formal parameters. The following code illustrates a simple generic class definition.
Visual Basic Copy Code
Public Class Generic(Of T)
Public Field As T
End Class
C# Copy Code
public class Generic<t>
{
public T Field;
}
C++ Copy Code
generic<typename t=""> public ref class Generic
{
public:
T Field;
};
When you create an instance of a generic class, you specify the actual types to substitute for the type parameters. This establishes a new generic class, referred to as a constructed generic class, with your chosen types substituted everywhere that the type parameters appear. The result is a type-safe class tailored to your choice of types, as the following code illustrates.
Visual Basic Copy Code
Dim g As New Generic(Of String)
g.Field = "A string"
C# Copy Code
Generic<string> g = new Generic<string>();
g.Field = "A string";
C++ Copy Code
Generic<string^>^ g = gcnew Generic<string^>();
g->Field = "A string";
The following terms are used to talk about generics in the .NET Framework:
A generic type definition is a class, structure, or interface declaration that functions as a template, with placeholders for the types it can contain or use. For example, the Dictionary class can contain two types: keys and values. Because it is only a template, you cannot create instances of a class, structure, or interface that is a generic type definition.
Generic type parameters, or type parameters, are the placeholders in a generic type or method definition. The Dictionary generic type has two type parameters, TKey and TValue, representing the types of its keys and values.
A constructed generic type, or constructed type, is the result of specifying types for the generic type parameters of a generic type definition.
A generic type argument is any type that is substituted for a generic type parameter.
The general term "generic type" includes both constructed types and generic type definitions.
Constraints are limits placed on generic type parameters. For example, you might limit a type parameter to types that implement the IComparer generic interface, to ensure that instances of the type can be ordered. You can also constrain type parameters to types that have a particular base class, that have a default constructor, or that are reference types or value types. Users of the generic type cannot substitute type arguments that do not satisfy the constraints.
A generic method definition is a method with two parameter lists: a list of generic type parameters, and a list of formal parameters. Type parameters can appear as the return type or as the types of the formal parameters, as in the following code.
Visual Basic Copy Code
Function Generic(Of T)(ByVal arg As T) As T
Dim temp As T = arg
...
End Function
C# Copy Code
T Generic<t>(T arg) { T temp = arg; ...}
C++ Copy Code
generic<typename t=""> T Generic(T arg) { T temp = arg; ...};
Generic methods can appear on generic or nongeneric types. It is important to note that a method is not generic just because it belongs to a generic type, or even because it has formal parameters whose types are the generic parameters of the enclosing type. A method is generic only if it has its own list of type parameters. In the following code, only method G is generic.
Visual Basic Copy Code
Class A
Function G(Of T)(ByVal arg As T) As T
...
End Function
End Class
Class Generic(Of T)
Function M(ByVal arg As T) As T
...
End Function
End Class
C# Copy Code
class A
{
T G<t>(T arg) {...}
}
class Generic<t>
{
T M(T arg) {...}
}
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Have a look at Wikipedia's article on generic programming[^]. It's a broad article, but still applies to C#.
|
|
|
|
|
The Article by Ansil Generics[^] In CP will help you.
Regards,
Satips.
|
|
|
|
|
Hello ALL,
I am having a class in vb 6.0 , i am able to call the class developed using C# but my question is how to debug the C# code during run time .
"Property decreases by sharing..
Knowledge increases by sharing ...."
Thanks in Advance.
Bharath.S Ron
|
|
|
|
|
Just make break point in the C# class. Run the Vb application and the application will
halt on the break point.
you can debug it as regular .net code.
Rahul Kulkarni
|
|
|
|
|
Attach the debugger to the program being run, and then you can set a breakpoint, etc.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i attached the debugger as well but it is giving me the out put directly it is not stopping at the break point..
bharath.s
|
|
|
|
|
I want to get and set the location of dockable window, when it is not docked to any side (when dock = none). I am not getting x, y coordinates of dockable windows when it is not docked to any side, coordinates are coming as 0,0
Any Ideas?
Thanks
kumar
|
|
|
|
|
I have embedded an XML in my application.I am able to read the XML but when i try to write on the embedded XML. It gives an error message which says: "Stream isnot writable".
Any idea on how to write in an embedded XML.
Also code on VB.Net appreciated.
Thank You!
X
|
|
|
|
|
You can put the XML in your properties for the app, then you can save them back out. If you embedd a resource, you can't write to it, that would mean an exe would have to write on itself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If that makes any sense...
I have a textbox to the left of a richtextbox. The textbox displays line numbers of the richtextbox. As you type into the richtextbox, line numbers appear in the textbox. If you type beyond the limits of the form, the numbers continue to roll with the flow, so to speak. However, if you scroll back up in the richtextbox, the textbox doesn't follow. How can I lock the two together so they move with each other up or down?
|
|
|
|
|
What have you already done ? It seems to me that there's no 'lock' property, you need to write the code to do it, so you need to post the code you've written so we can see what's wrong with it
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I haven't written any code for "locking" the two together. I have searched for relevant code snippets and ideas to do this, but haven't found any. I'm not asking anyone to write it for me -- I can't learn this stuff if every time I need help someone just does it for me. I just need some pointers.
Thanks...
|
|
|
|
|
"If you type beyond the limits of the form, the numbers continue to roll with the flow, so to speak."
How is this working then ? Or did I misunderstand and this is a description of what you want, not what you have ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Ah, ok...I misunderstood what you were asking. See the code below that creates the line numbers in textbox1:
Here's the code that does the work:
private void updateNumberList()
{
Point pos = new Point(0, 0);
int firstIndex = richTextBox1.GetCharIndexFromPosition(pos);
int firstLine = richTextBox1.GetLineFromCharIndex(firstIndex);
pos.X = ClientRectangle.Width;
pos.Y = ClientRectangle.Height;
int lastIndex = richTextBox1.GetCharIndexFromPosition(pos);
int lastLine = richTextBox1.GetLineFromCharIndex(lastIndex);
pos = textBox1.GetPositionFromCharIndex(lastIndex);
textBox1.Text = "";
for (int i = firstLine; i <= lastLine; i++)
{
textBox1.Text += i + 1 + " \r\n";
}
}
Here's the code that calls it:
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
updateNumberList();
}
|
|
|
|
|
OK - the problem is probably to do with GetCharIndexFromPosition. I don't see why you're doing that. You should be able to get the index from the cursor position, which is retrieved from the selection start property. If you step through the code when you step back, you should see which line is not giving the value you'd hope, but I do think that's the way to get the correct index, all the time.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Instead of scrolling the textbox, find the number of the first visible line in the richtextbox.Say if it is 15 and the text box can show only 'n' numbers,
textBox1.text="";
for i=15 to 15+n
textBox1.Text+=i+"\n";
Regards,
Arun Kumar.A
|
|
|
|
|
Hi!
I'm not sure if I understand correctly what you try to achieve, but there a quite useful article about line numbers for the RichTextBox[^] here on CP.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|