|
oh yeah, i tried this and in body i tried to return 0 or 1
but it gave errors, but now i have a good way that you told
thanks CAM
Becoming Programmer...
|
|
|
|
|
Hi All/Luc,
Is there a Big Integer package in C#? I don't want to jump through API hoops to do big math (nothing like the suffering of attaching an image list to a tree view ). Next, is there a Bas64 Encoder/Decoder available in C#?
I seem to be pulling lower quality suggestions from Google. So rather than jump into it, I'll wait for the advice.
Thanks,
Jeff
|
|
|
|
|
Hi Jeff/All,
1.
there are several big integer packages publicly available. Maybe the most acclaimed one is
GMP (GNU Multi-Precision). IIRC its written in C++, I haven't seen a .NET wrapper for it though.
And there are some articles on CodeProject[^] covering this (with different capabilities and
qualities). Much depends on what it is you want to achieve.
2.
Not sure what you mean, maybe Convert.FromBase64String() and its sibblings will help you.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: And there are some articles on CodeProject[^]
I wrote the first article.... I'll get a port together to C#. Do you want to coauthor? I'll have problems with the Managed/Unmanaged thunk. (This is my third day on C#.)
Luc Pattyn wrote: Maybe the most acclaimed one is GMP (GNU Multi-Precision).
I'm a Crypto++ man myself. Years ago (circa 1998), I was never able to get a clean port of GMP to Windows.
Luc Pattyn wrote: Not sure what you mean, maybe Convert.FromBase64String()
Perhaps - I'll have to look at it.
Luc Pattyn wrote: Much depends on what it is you want to achieve.
This is going to be an article on Crypo++ interoperability with other Crypto Libraries and standards. The first article in this series is (somewhat out of order) is ASN.1 Object Identifier Encoding and Decoding[^]. It became such a large topic, it was spun off. In reality, it was supposed to be part of a Cryptographic Certificate Parser (*.CER, *.P7B, etc).
The TreeView is used for displaying results of the parser - the icons are a UI element aiding in vidualization of the message structure.
Jeff
|
|
|
|
|
Jeffrey Walton wrote: I'll get a port together to C#. Do you want to coauthor? I'll have problems with the Mnanaged/Unmanaged thunk
Hi Jeff, that's something we can look into. I'll send you an e-mail...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,when i run my project in C# it dosen't define ReportViewer1.BorderStyle="solid" code that i have wrote in my ReportForm.Cs source file.How can i write code like this with out using ReportViewer Toolbar before running the project to define my Report Page setup as like as Border Style seting ,page setup setting for example my papaer size to be A4 and margin setting and other properties of my Report without defining these properties at running time or design time only with writing code in source file in my report from ?
thanks
D.Riazi
-- modified at 8:40 Sunday 18th November, 2007
D.Riazi
|
|
|
|
|
Hi,
I am trying to run the exe file that was generated by vs.net in another computer, but it posts an error message and I can not run it. How can I do this please. Thanks.
Hawari
hawari
|
|
|
|
|
What is the error message?
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi,
This is the error message "The application failed to initialize property (0xc0000135)". Thanks
hawari
hawari
|
|
|
|
|
That is the cryptic message Microsoft has designed to tell you you don't have
(the right version of) the .NET Framework. So decide which version you need,
look for the download site and install it.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
The Undefeated wrote: What is the error message?
Someone voted you a 3 for that perfectly reasonable, logical and understandable question. Someone is obviously a moron.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
lol, i want to know that person
Becoming Programmer...
|
|
|
|
|
xmen_xwk wrote: i want to know that person
Why would anybody want to know a moron?
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
because anybody must know that person and aware too
Becoming Programmer...
|
|
|
|
|
Simple way to run Exe is.
Process process = new Process();
process.StartInfo.FileName = "notepad.exe";
process.Start();
thats all i know.
Thanks
"Good Thing Goes With Good People..."
|
|
|
|
|
Well i was working on a very simple project , In windows application form1 i want set a password to modify, there are two buttons in the form which can be activated if user enters correct password.
Notice forms controls are: label, textbox1, button1 and button2.
who can send me code snippet for above would be great indeed!
thanks pls help me!!
so much of happy ending...
|
|
|
|
|
Have you made an attempt to solve the problem yourself?
This site is for people who want to learn, not for people who want their (home)work done for them.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi.
I have the follow:
1. System.Data.DataTable dt = new System.Data.DataTable();
2. dt = dal.Search(findfile.Text); // I receive the data correctly
3. dt.WriteXML(YourSearch);// I'm trying to create a xml file from the datatable
4. Response.TransmitFile(YourSearch);//download xml file
In the thirth row, when i run (compile ok) I receive
"Cannot serialize the DataTable. DataTable name is not set"
What that mean?
thanks.
|
|
|
|
|
It means what it says. Set the TableName property for your DataTable.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi, I'am have similar problem,but I resolved it
the trick is set the TableName between DataTable is transmited and DataTable is received have a same name
|
|
|
|
|
hi, i want to change system language (language bar) to second language(FA) while one of my textbox in the form has the focus.and again back to normal (EN) when going to next textbox.
so how can i do that?
|
|
|
|
|
solved mostly: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2423864&SiteID=1&mode=1
I have this functionality i want to port from WinForms but i run into a few problems and i can't continue. What it does is move a panel(canvas) around as i click and hold and drag the mouse). I saw the sample using TranlateTransform(XAML) but i can't get any code-behind example, this is dynamic and interactive. I managed to make some out only need the translation solved(and possibly a good approach on using this with Margin, wich seems the only tool i got to moving the canvas around?).
Code Block#region Pan tool
private bool mMovingPanel;
private Point mMousePos;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
mMovingPanel = e.Button == MouseButtons.Left;
// prev mouse pos
mMousePos = panel1.PointToScreen(e.Location);
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (mMovingPanel)
{
// "this mouse pos"
Point pos = panel1.PointToScreen(e.Location);
// "this mouse pos" - "prev mouse pos" = offset
Size adj = new Size(pos.X - mMousePos.X, pos.Y - mMousePos.Y);
// Location + offset = Location (final - unassigned)
Point loc = panel1.Location + adj;
if (panel1.Width >= this.ClientSize.Width && panel1.Height >= this.ClientSize.Height)
{
if (loc.X > 0) loc.X = 0;
if (loc.X + panel1.Width < this.ClientSize.Width) loc.X = this.ClientSize.Width - panel1.Width;
if (loc.Y > 0) loc.Y = 0;
if (loc.Y + panel1.Height < this.ClientSize.Height) loc.Y = this.ClientSize.Height - panel1.Height;
}
else if (panel1.Height >= this.ClientSize.Height)
{
if (loc.X < 0) loc.X = 0;
if (loc.X + panel1.Width > this.ClientSize.Width) loc.X = this.ClientSize.Width - panel1.Width;
if (loc.Y > 0) loc.Y = 0;
if (loc.Y + panel1.Height < this.ClientSize.Height) loc.Y = this.ClientSize.Height - panel1.Height;
}
else
{
if (loc.X < 0) loc.X = 0;
if (loc.X + panel1.Width > this.ClientSize.Width) loc.X = this.ClientSize.Width - panel1.Width;
if (loc.Y < 0) loc.Y = 0;
if (loc.Y + panel1.Height > this.ClientSize.Height) loc.Y = this.ClientSize.Height - panel1.Height;
}
// Location(final - assigned)
panel1.Location = loc;
// "this mouse pos" set aside as "prev mouse pos"
mMousePos = pos;
}
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
mMovingPanel = false;
}
#endregion
This is my attempt, i know it lacks but hopefully it will speed things up:
Code Block#region Pan tool
private bool mMovingPanel;
private Point mMousePos;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
mMovingPanel = Mouse.LeftButton == MouseButtonState.Pressed;
// prev mouse pos
mMousePos = canvas1.PointToScreen(Mouse.GetPosition(canvas1));
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (mMovingPanel)
{
// "this mouse pos"
Point pos = canvas1.PointToScreen(Mouse.GetPosition(canvas1));
// "this mouse pos" - "prev mouse pos" = offset
Vector adj = new Vector(pos.X - mMousePos.X, pos.Y - mMousePos.Y);
// Location + offset = Location (final - unassigned)
Thickness currentThickness = new Thickness();
Thickness loc = new Thickness(currentThickness.Left + adj.X, currentThickness.Top + adj.Y,
currentThickness.Right, currentThickness.Bottom);
if (canvas1.ActualWidth >= this.ActualWidth && canvas1.ActualHeight >= this.ActualHeight)
{
if (loc.Left > 0) loc.Left = 0;
if (loc.Left + canvas1.ActualWidth < this.ActualWidth) loc.Left = this.ActualWidth - canvas1.ActualWidth;
if (loc.Top > 0) loc.Top = 0;
if (loc.Top + canvas1.ActualHeight < this.ActualHeight) loc.Top = this.ActualHeight - canvas1.ActualHeight;
}
else if (canvas1.ActualHeight >= this.ActualHeight)
{
if (loc.Left < 0) loc.Left = 0;
if (loc.Left + canvas1.ActualWidth > this.ActualWidth) loc.Left = this.ActualWidth - canvas1.ActualWidth;
if (loc.Top > 0) loc.Top = 0;
if (loc.Top + canvas1.ActualHeight < this.ActualHeight) loc.Top = this.ActualHeight - canvas1.ActualHeight;
}
else
{
if (loc.Left < 0) loc.Left = 0;
if (loc.Left + canvas1.ActualWidth > this.ActualWidth) loc.Left = this.ActualWidth - canvas1.ActualWidth;
if (loc.Top < 0) loc.Top = 0;
if (loc.Top + canvas1.ActualHeight > this.ActualHeight) loc.Top = this.ActualHeight - canvas1.ActualHeight;
}
// Location(final - assigned)
canvas1.Margin = loc;
// "this mouse pos" set aside as "prev mouse pos"
mMousePos = pos;
}
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
mMovingPanel = false;
}
#endregion
-- modified at 1:04 Monday 19th November, 2007
|
|
|
|
|
I like C# but its useless in my applications because I can not protect my source code as its always included in deliverables.
Is there any real solution coming for this in near future or should I just give up C# .NET.
I believe this should be major concern for many but I haven's see Microsoft taking any role for this.
|
|
|
|
|
triag wrote: I can not protect my source code
No.. You don't need to give your sourcecode to your client.. After making the setup file, there won't be any sourcecode in your setup file..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
I tried this by making simple windows forms application and publish it. I select The application is available offline as well.
It generated setup.exe and subdirectory Application files. Under that there is file application.exe.deploy
I renamed that to be application.exe and open it Lutz Roeder's reflector. It was able to re-generate my source code from that. I think my clients can do same.
|
|
|
|