|
What I would do, I'm sure there is a better way, is just append a JavaScript function and a hidden textbox to the innerHTML of the loaded document.
then call InvokeScript on the webbrowser to run your JavaScript (which should set the hidden textboxs text to the inner HTML of the iframe) then get the text from the textbox by getting the innerhtml and parsing out the textbox value.
Like I said I'm sure there is a better way.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
Any idea on what the script would look like? I have not done a lot of web programming.
|
|
|
|
|
Found this on the net that allowed me to use HttpWebRequest (as suggested earlier).
http://mmarinov.blogspot.com/2007/10/using-exsiting-ie-cookies-with.html[^]
Thanks for all those that helped - refining the definition of the problem was very helpful.
Special Note: The WPF WebBrowser control doesn't even fire the events (IFrame navigation) necessary for the above solution. I have to use the Windows Forms version.
modified on Friday, July 24, 2009 2:07 PM
|
|
|
|
|
Public class MyClass<t> where T:int
{
}
why it's giving error. why .net framework not supporting
|
|
|
|
|
You can use struct
public class MyClass<T> where T : struct
{
}
or wrap an int in a (immutable?) class of your own and use that for the constraint.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
why this restriction.
Allowing struct. what problem allowing int?
|
|
|
|
|
You'd have to ask Anders Hejlsberg[^]. It's the way generics were built into C#. Search for generic type constraints and you might find some reasoning.
MSDN[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
public class MyClass<T>
{
...
}
MyClass<int> myClass = new MyClass<int>();
is this what you need ?
|
|
|
|
|
public class CplusEnumExtension<t, f=""> : whehre T:int
{
public CplusEnumExtension(int t)
{
enumT = t;
}
public bool Has(F findvalue)
{
return ((int)(object)enumT & (int)(object)findvalue)>0;
}
private int enumT=0;
}
In above code Has method i comparing int type that's why i expecting int from client side.
Apartment from this
I have implemented code below in C++ which client can use any type.(int, long etc) Is it possible in C#
//EnumT->int,long,Ulong...0x0001;
//Findvalue->ePDVE_DllError
//usage : CEnumerationExtensions<ULONGLONG,ePileplandesign_verificationError> obj(errorcode);
template <typename enumt,typename="" findvalue="">;
class CEnumerationExtensions
{
public:
CEnumerationExtensions(EnumT e)
: enum_(e)
{}
public:
bool Has(Findvalue value)
{
return ((enum_ & static_cast<enumt>(value))>0);
}
private:
EnumT enum_;
};
|
|
|
|
|
What types do you expect you should be able to use with "int" as a constraint?
You would only be able to use a single type - "int" itself (no uint, long etc. - those don't derive from int).
But if there's only one possible type argument, it doesn't make sense to use generics at all!
|
|
|
|
|
Hi,
you might want to enumerate the acceptable types and use common features:
public class MyClass<T> where T : int, long, float, double and now perform addition.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
But multiple constraints mean the type T must implement all of those.
There is no way to say "int OR float" (which would have to automatically generate an interface with all methods common between int and float).
But unfortunately, .NET doesn't support 'dynamic interfaces' (you declare an interface, and all classes having the appropriate methods will automatically implement it). Actually, I think VB10 will have something dynamic interfaces, but I guess it'll be implemented on top of Reflection/the DLR.
|
|
|
|
|
Thanks.
Syntax proposal: public class MyClass<T> where T in { int, long, float, double }
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Right, that would be good. Or the numeric types should implement some sort of IDoMath interface and we could use that.
I also want an enum constriant.
|
|
|
|
|
If they made it so we had a Numeric constraint, or they implemented some common interface (INumeric), that would fix it for all the integral data types and enums too in one go.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I want enums separate from the other types. I have generic classes that should accept enums only. As it stands, I have to check at runtime and throw and Exception.
|
|
|
|
|
Hi,
I'm using the control SplitContainer on run time.
uppon request I'm generating a tab that contains SplitContainers.
I set all the properties as needed including the SplitterDistance,
BUT when the application is running the spliter is not positioned as expected.
it seems that it use some default parameter that ovveride the explicit setting.
Thanks for your help,
lune
|
|
|
|
|
Its hard to comment about it but a wild guess could be to check your dock and anchor properties.
|
|
|
|
|
The dock is fill.
and anchor is top and left.
I saw that if I set the parameter in an event such SelectedIndexChange it works.
but I feel that is wrong to do such a thing (and also it doesn't cover all the cases)
any other guess?
Thanks.
|
|
|
|
|
this comment made me think that may be its some code level change overriding the design view changes. Go through your code and make sure that your adjusted styles not being overridden at code level.
|
|
|
|
|
datagrid is having 4 values.
presently selection is on 4'th record and it is moving to 2'nd record...
how to get previously selected column index(i.e 4'th record) index.
can anyone help me
|
|
|
|
|
i got the code...
thank you...
if (gvcomments.Rows[pre_Index].Cells[CommonConstants.Created].Style.ForeColor == Color.Red)
{
gvcomments.Rows[pre_Index].DefaultCellStyle.Font = new Font(gvcomments.SelectedRows[0].InheritedStyle.Font, FontStyle.Bold);
}
else
{
gvcomments.Rows[pre_Index].DefaultCellStyle.Font = new Font(gvcomments.SelectedRows[0].InheritedStyle.Font, FontStyle.Regular);
}
|
|
|
|
|
handle related index change event and always keep track of previous index in some location. In this way you will always have a valid old index saved and before updating it to newer index you can make use of it.
|
|
|
|
|
Hi,
I'm writing TCP application to communicate with a server machine. There is an interesting thing called TCP Window Scaling, how can i achieve through C#?
|
|
|
|
|
satsumatable wrote: I'm writing TCP application to communicate with a server machine. There is an interesting thing called TCP Window Scaling, how can i achieve through C#?
Based on the Wikipedia definition of TCP Window Scale Option[^], it seems you don't achieve it at the application level.
|
|
|
|