|
Thanks , you're nice my friend.
Freshman
|
|
|
|
|
hammerstein05 wrote: my understanding of this is that the string needs to be divisible by 64
That is not correct, but if the number of characters is divisable by 4 it happens to form a base64 string that needs no extra characters at the end to be decodable.
As the length is incorrect for a base64 string, it's probably "modified base64" that is used. Here you can read about how the string is padded at the end with "=" characters, and how "modified base64" doesn't use those:
wikipedia: Base64[^]
To make the .NET method decode the string, you can determine how many "=" characters should be added at the end, from the number of characters in the string (after all white space has been removed).
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thank-you, I appreciate being educated on this.
|
|
|
|
|
i think after you remove the header...base64, you forget to remove all whitespace from that string, i try not add 20 character that suggested and it works(look like zeppelin and zine)
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
hammerstein05 wrote: I copied 20 characters from within the string, tagged it on the end and it displays ok.
Which charecters did you copy ?
Freshman
|
|
|
|
|
Doesn't matter, just copy 20 characters.
I actually tried to just adding random letters on the end, it still worked.
|
|
|
|
|
Thanks a lot hammerstein05.
Freshman
|
|
|
|
|
MDI WinForms 2 application.
I need that Ctrl+F1 cycles through windows like Ctrl+Tab.
I overrided MDI child form OnKeypress method but Ctrl+F1 press is ignored.
How to force Ctrl+F1 to cycle between windows ?
Andrus.
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Control | Keys.Tab:
return true;
case Keys.Control | Keys.F1:
keyData = Keys.Control | Keys.Tab ;
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
Andrus
|
|
|
|
|
If focused control is ReadOnly, Ctrl+E menu shortcut key is ignored.
To reproduce, run code below, press Ctrl+E.
Message box does not appear.
How to use Ctrl+E key from readonly or disabled control ?
Andrus.
using System;
using System.Windows.Forms;
static class Program
{
static void Main()
{
Application.Run(new Form1());
}
}
class Form1 : Form
{
public Form1()
{
menuStrip1 = new MenuStrip();
fileToolStripMenuItem = new ToolStripMenuItem();
openToolStripMenuItem = new ToolStripMenuItem();
textBox1 = new TextBox();
menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem });
fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { openToolStripMenuItem });
fileToolStripMenuItem.Text = "File";
openToolStripMenuItem.ShortcutKeys = ((Keys)((Keys.Control | Keys.E)));
openToolStripMenuItem.Text = "Open";
openToolStripMenuItem.Click += new System.EventHandler(openToolStripMenuItem_Click);
textBox1.Location = new System.Drawing.Point(55, 150);
textBox1.ReadOnly = true;
Controls.Add(textBox1);
Controls.Add(menuStrip1);
MainMenuStrip = menuStrip1;
}
void openToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("Clicked");
}
MenuStrip menuStrip1;
ToolStripMenuItem fileToolStripMenuItem;
ToolStripMenuItem openToolStripMenuItem;
TextBox textBox1;
}
Andrus
|
|
|
|
|
I am using Sql Server 2005 Compact Edition as a database and I can't seem to get this thing to add a simple record... I run the a simple Insert statement and the Table is still empty. I get no error code or anything... Has anyone else been able to add records to a Compact Edition table in Visual Studio 2005 using C#??? Here is my code...
INSERT INTO TimeZone
(state, abbrev, tzone)
VALUES (@p1, @p2, @p3)
Now the one thing that isn't showing is my primary key field which is "tzid". But it is autonumbered. I fill in the values in code for @p1, @p2, @p3. When I open up the TimeZone table, it is empty... Any help would be appreciated. Thanks
|
|
|
|
|
I've no experience with CE but are you able to execture your query with your parameters from a Management Studio?
|
|
|
|
|
please put your code over here
|
|
|
|
|
Is it possible to get the left-most coordinate (the left edge of the Region) for a specific y-coordinate? I thought about getting the bounds for the Region, then start at the x-coordinate and work my way in with IsVisible(), but it's very slow. Does anybody have any other ideas?
Thanks!
|
|
|
|
|
If you can't divide the bounds of the region into lines (so that you can use simple linear math to calculate the coordinate), you can use a binary search to call IsVisible as few times as possible.
Pick two points, one that you know is to the left of the region, and one that you know is inside the region. Calculate the point that is exactly in the middle of those two points. Use IsVisible to find out if that point is inside the region or not. If it is, use that as the new rightmost point, otherwise use it as the new leftmost point. Repeat the process until the distance between the points is small enough.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Guffa,
I haven't done this, but I would expect the region class to have methods to solve this.
How about intersecting with a rectangle (height 1), then call GetBounds?
|
|
|
|
|
Thanks! I'll go with the latter one. I hadn't thought of that :> brilliant! thanks.
|
|
|
|
|
Hi
The pattern is sth like this:
<br />
^-?((?<X>[0-9]{0,8})/(?<Y>[0-9]{0,15})|(?<X>[0-9]{0,8}))\*?$<br />
and I want to have the variables in their named groups as following
X=...
Y=...
I don't know how to use MatchCollection, CaptureCollection ,etc. Can anyone help me?
|
|
|
|
|
A good starting point would be MSDN help That section is extensive and pretty well written.
Let's start with a simpler pattern. Once you get it working you can make it more complex.
Suppose your pattern is smth like the following: (?<var1>\w+)
"var1" is the name of your capture
Regex r = new Regex(patter<, RegexOptions> );
MatchCollection mc = r.Matches(your_text_to_match);
if (mc.Count > 0)
{
}
Well, something along these lines anyway, I'm typing it from the memory, can't check the syntax on the home pc.
|
|
|
|
|
// get the value with: mc[i].Groups["var1"].Value;
Thanks a lot, that was so useful
modified on Wednesday, June 25, 2008 1:50 PM
|
|
|
|
|
another site that has helped me a lot in the past is
http://www.regular-expression.info/[^]
they even have a tool that you can use to quickly test your regex's
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I writea easy loop like below:
for( int i = 0 ; i < 10 ; i ++)
{
Console.WriteLine( System.DateTime.Now.Ticks );
}
the result is always is
633500324611875000
633500324611875000
633500324611875000
633500324611875000
633500324611875000
.......
Can anyone tell me why ? why it always the same ?
|
|
|
|
|
because For statement is very quick.
try it :
for (int i = 0; i < 10; i++)
{
Console.WriteLine(System.DateTime.Now.Ticks);
Thread.Sleep(1000);
}
Console.ReadKey();
Freshman
|
|
|
|
|
thanks, its export different value right now, but the result below:
633500343525625000
633500343526562500
633500343527656250
633500343528593750
633500343529687500
633500343530625000
633500343531718750
is the unit of tick is 50? I guess by the result. thanks
|
|
|
|
|
Hi,
you may find details on timing in my timers article.
|
|
|
|
|
matthew_net wrote: is the unit of tick is 50? I guess by the result. thanks
It's hardware dependent. Not all machines will tick at the same rate, so you shouldn't use it to control anything that needs to run at a fixed rate.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|