|
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.
|
|
|
|
|
I have a Sys Tray Application with a NotifyIcon,
But I have a big problem that I have been trying to solve for days now.
If I want the Application to show a window, but if I want to do it from another thread . How do I do that then ?
I know that if I have a normal Window Application I can solve this by using invoke, etc.
But ApplicationContext have no such methods, like invoke.
What do I do ? How can I make my own Synchronizer, that can help me call a method on the Application main gui Thread ?
Can i make somekind of workaround, with a mainform that is not shown at all?
Best regards, Anders Both - Denmark.
|
|
|
|
|
Hi every one , this is my first entering to this forum.
I hope we will help ourselves to be professional in C#
C# interested
|
|
|
|
|
I don't understand what the point of interfaces are? Can you explain it to me?
/\ |_ E X E GG
|
|
|
|
|
|
what is that eggie5 on??????
Cheers
|
|
|
|
|
I need to show a loading message or retrieving data message while im accessing to any webservice for data
|
|
|
|
|
Create it in another thread it will do that jop
|
|
|
|
|
Hi experts,
I am trying to display data in a datagrid from a xml file. I have no problem reading the xml file, however when i try to display the data in a datagrid all i get is "null" values. I have bound my dataset to the datasource property but still dont know where im going wrong
can anyone point me in the right direction???
Cheers
|
|
|
|
|
A simple example:
DataSet ds = new DataSet();<br />
ds.ReadXml("99999.xml");<br />
<br />
this.dataGrid1.DataSource = ds.Tables[0].DefaultView;<br />
<br />
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.dataGrid1.DataSource, this.dataGrid1.DataMember]; <br />
((DataView)cm.List).AllowNew = false;<br />
<br />
this.dataGrid1.CaptionText = "Total Tasks: " + dataGrid1.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember].Count.ToString();
Hope this helps
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
I want to get the value(the X and Y value)of a curve from a .jpg file?
get the value of the curve from a .jpg file.
could anyone give me a sample about it?
my E-mail: dxhdxh2k@hotmail.coom
Thanks
|
|
|
|
|
How many times are you going to ask this question ? I've answered it several times, you obviously just want someone to write code for you. I suggest going to rentacoder if you want some cheap code to do this. It might even work.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
My aim is to use the above specified classes for encryption and decryption on strings send across the network.
I am unable to find how to use these two classes put together.
Can anyone help me in this regard. Early response is encouraged.
|
|
|
|
|
Hi,
1) Create the key and IV
2) Create a crypto service provider
3) Create a crypto stream
4) Create new stream writer on the crypto stream
byte [] key ={171, 196, 154, 92, 35, 195, 212, 50};
byte [] IV ={65, 86, 22, 91, 214, 4, 177, 199};
try
{
DESCryptoServiceProvider dsp = new DESCryptoServiceProvider();
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms,dsp.CreateEncryptor(key,IV),CryptoStreamMode.Write);
StreamWriter sw = new StreamWriter(cs);
sw.Write(textBox1.Text);
sw.Flush();
cs.FlushFinalBlock();
ms.Flush();
textBox2.Text = Convert.ToBase64String(ms.GetBuffer(),0, (int)(ms.Length));
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
Hope this will help you.
Thanks and Regards
SGS
|
|
|
|
|
I am intereseted in developing network application where a server and client will just pass the text messages. I am using Tcp sockets. I could not incorporate networkstream classes in the context. I mean to say that I have to work with networkstream, streamwriter or streamreader and cryptostream classes put together.
Hope you understand the situation.
|
|
|
|
|
Hi there..
There is a lot of examples on how to do the server client stuff in the .Net framework documentation. Search for "TCP" and you'll get something usefull! About the cryptographic stuff:
<br />
public string Encrypt(string ToCrypt)<br />
{<br />
string encoded = "";<br />
byte [] EncKey = {0x16, 0x1F, 0x01, 0x03, 0x1A, 0x0B, 0x10, 0x7F, 0x65, 0x5E, 0x45, 0x3F, 0x11,0x1F, 0xFF, 0xEF, 0x32, 0xEE, 0x5F, 0x38, 0xA7, 0xB2, 0xCC, 0x77, 0x51, 0x14, 0x40, 0x8A, 0x95, 0xE5, 0x00, 0x84};<br />
<br />
byte [] EncIV = {0x05, 0x14, 0x06, 0x15, 0x02, 0x13, 0x00, 0x0F, 0xC0, 0xD8, 0xB6, 0x58, 0xE4, 0xA9, 0x21, 0x5E};<br />
<br />
RijndaelManaged rmEnc = new RijndaelManaged();<br />
rmEnc.Key = EncKey;<br />
rmEnc.IV = EncIV;<br />
<br />
StreamWriter sw = new StreamWriter(encoded);<br />
CryptoStream cs = new CryptoStream(sw, rmEnc.CreateEncryptor(rmEnc.Key, rmEnc.IV), <br />
CryptoStreamMode.Write);<br />
cs.Write(Encoding.ASCII.GetBytes(ToCrypt), 0, ToCrypt.Length);<br />
<br />
cs.Close();<br />
sw.Close();<br />
<br />
return encoded;<br />
}<br />
If this wasen't what you were looking for, you must express yourself more clearly. What is the exact problem?
|
|
|
|
|
Hi Aijaz,
You can initialize the crypto stream class using any class that's derieved from Stream class. (Ex File Stream , Memory Stream, NetworkStream).
Using NetworkStream:
TcpClient client = new TcpClient();
NetworkStream ns = client.GetStream();
CryptoStream cs = new CryptoStream(ns,dsp.CreateEncryptor(key,IV),CryptoStreamMode.Write);
StreamWriter sw = new StreamWriter(cs);
Guess this will help you.
Thanks and Regards
SGS
|
|
|
|
|