|
im trying to request a web but its needs a proxy with authenticantion i have alredy creat a WebProxy object to setit up the WebRequest.Proxy property but idont know how to configure or setup the WebProxy credentials for this proxy authentification can any one give a hand on this
regards alex
|
|
|
|
|
Hi all,
I have a class that owns a "protected" method (let's say 'Class1'; method: 'AddVar'). Now, I want to use reflection to obtain this class and inherit it to a local class.
Something like:
Public Class LocalClass : Assembly.LoadFrom("..PathToClass1..").GetType("Class1")
I now the line above is too good to be right.
Is what I want even possible? If so, How do I define it?
Thanks
MGKido
|
|
|
|
|
|
To build a class "runtime" using reflection is..."tricky". You need to use classes out of System.Reflection.Emit to dynamically buildup the class and method calls at runtime. Even then, if the protected method is flagged virtual it adds another wrinkle.
All of this is entirely possible (I've done it) but it is not easy nor for the faint of heart.
This leads me to ask this: what are you really trying to do? Isn't the assembly and the class available to derive from? Why bother using reflection to do this at all? You should always avoid solutions that are unnecessarily complex.
|
|
|
|
|
Okay,
1. I almost abandoned the thread because of 2 things:
a. Didn't get any real answers.
b. Managed to do it using a code sample that I (think) dowloaded from this site.
The code uses reflection to display all the methods is a given assembly. I noticed that the code manages to display a protected class (I couldn't even see it - that's why I needed to inherit the class). Then I took the code of getting to the protected class and tried to invoke it. It worked.
For future users looking for the answer - You should use BinsingFlags enumerator to expose the method:
"BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.InvokeMethod"
|
|
|
|
|
I've made a capture application in c# with DirectShow and I currently obtain an output file. I am now developping a video conferencing application and I would like to transform the capture to obtain a stream instead the output file in order to be able to put this live stream on a serveur. And then the participant of the video conference will be able to read the stream from the serveur.
So, I just want to replace the SetOutputFileName function by a system (even by working directly on the COM object if it's not possible with a c# function) to recover directly the output stream.
Is it possible to obtain a stream in output of a DirectShow capture?
Which method can I use in c# to do this?
Thanks for your help
Julien
|
|
|
|
|
Hey Guys !
Anyone knows how to control the space between characters (kerning) using the graphic libraries provided for the .NET Framework 1.1 ?
Thanks a LOT !!!
|
|
|
|
|
|
Thanks,
And... about Google .... I'm here because my search about this topic has no answers. I'm trying with TextRenderingHint.
Thanks again !
|
|
|
|
|
Hi there,
How do I pick the screen-pixel-color from C#?
More precisely, I want to pick a color from a line drawn on a form.
IE: not a bitmap on the form but a line drawn with e.Graphics.DrawPath(etc).
I tried this forum, Google ... where did I miss it?
Thanks,
Akos
|
|
|
|
|
|
Yeah, but you'r is FAR more complicated. You will have to take that color and search around it looking for pixels of the same, or similar color. Then you'll have to feed the coordinate for all those pixels into some form of a curve fitting algorithm. This, you'll probably find in some univerisity research paper somewhere. Don't ask for a code sample, 'cause I don't have one. Let your fingers do the walking through Google...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
AFAIK you'd have to create a screenshot of the form (there are articles here on CP dealing with this). Then you can use GetPixel() for the resulting bitmap.
Regards,
mav
|
|
|
|
|
Why dont you add pencolor property while drawing line and retrieve it as and when required!!
Hope it helps.
MaulikCE
|
|
|
|
|
I'm not quite sure what you mean. I know the color i'm looking for.
What I I don't know is, how do i get the color of a pixel on the screen under the cursor.
Or on another way: how do i get the color of any pixel on the screen?
I know, I could use the API. Is there a way to do it from C#?
Thanks,
A
|
|
|
|
|
I am trying to serialize a simple class over the network.
I found the following error at receiver side.
Additional information: Cannot find the assembly BinaryDataSender, Version=1.0.1934.14107, Culture=neutral, PublicKeyToken=null.
What might be the problem? for this also I tried a lot to find the information regarding this, but in vain.
MOhammed Aijaz MOhiuddin.
|
|
|
|
|
what formatter do you use? SOAP, XML, Binary?
how do you serialize and deserialize your instance?
|
|
|
|
|
Dear all,
I tried to include the above namespace in my new project of Visual C#. I could not do so. Later I tried on two other systems, the same problem.
Then I opened a previous project of me, I find that System.Runtime.Serialization.Formatters.Soap namespace is there. Then I tried to include the same namespace by a dummy statement in previous project, I find that I can include the same namespace.
What might be the reason ?, I have wasted lot of time and then consult this Message Boards.
Thank you
|
|
|
|
|
You can't do a using statement successfully until the library is included in the list of references at the top of your project in the Solution Explorer. You can't use it until it's part of your project.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks for that Mr. Christian.
|
|
|
|
|
Using a Windows Form I have a RichTextBox at the bottom of the form. The form is scrollable. I'm loading a rtf file into the richtextbox. I wan't to be able to have the richtextbox resize itself to fit the contents of the rtf file that was loaded. The rtf document does have some images in it.
Can anyone help me out?
|
|
|
|
|
ok lets see first u must set the the dock property to top then in the paint event do somethink like this
private void RichTextBox1_paint(object sender, PaintEventArgs e)
{
int lines;
int chars;
RichTextBox rchtxb = (RichTextBox) sender;
StringFormat myformat = new StringFormat();
myformat.FormatFlags = StringFormatFlags.DisplayFormatControl;
SizeF layout = new SizeF(this.Width,this.Height);
int newheight = 6 + Convert.ToInt16(e.Graphics.MeasureString(rchtxb.Text,rchtxb.Font,layout,myformat,out chars,out lines).Height);
rchtxb.Height = newheight;
this.heigth = newheigth
}
yo listen if u wantso u can do this in a simple void just like thus
void autoresize(object sender, painteventargs e)
and then ind ther pain event of anny richtextxbox call it;
i hope this help if need any thing else tell me by email alexcuban@inder.co.cu
|
|
|
|
|
Sorry didn't help. The richtextbox is at the bottom of the form so it can't be docked to the top. Couldn't get the code to work. Where exactly do i put the code? And how do i call it?
Thought it would be easy enough to do, oh well..
Where is says:
this.richTextBox2.Size = new System.Drawing.Size(760, 200);
can this line not be changed to call a function that autoresizes the richtextbox??
|
|
|
|
|
How to copy file from a directory to another
Thanks in advance
|
|
|
|
|
see this[^]
<italic>Work hard, Work effectively and a bit of luck is the key to success.
|
|
|
|