|
You're missing some data. Ignoring the image / data stuff at the beginning, the rest of the string isn't long enough for base 64. I copied 20 characters from within the string, tagged it on the end and it displays ok.
|
|
|
|
|
Thanks friend.
hammerstein05 wrote: I copied 20 characters from within the string, tagged it on the end and it displays ok
Can you explain more ?
Freshman
|
|
|
|
|
data:image/png;base64,
if you get rid of that section at the beginning, you'll get an error along the lines of base64 string is of incorrect length. Well, the string is 312 characters, my understanding of this is that the string needs to be divisible by 64, so the next one up (removing characters would remove image data) would be 832 characters in length. So, I copied 20 characters from within the string and tagged them on the end. Admittedly, there would be incorrect image data, but it should still work. And it did. It displays an icon. It's probably the favicon.ico (Zine is the word on the icon)
That's how I got it working. Your code is pretty much correct.
|
|
|
|
|
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
|
|
|
|