I don't need to store the data - actually, the downloaded bytes should just be deleted afterwards. Thought about doing something like this: reader.ReadBytes(1000); reader.Position = (file.Length - 1000); reader.ReadBytes(1000); Would that work? And what is the file is smaller than 1000kb?
jafingi
Posts
-
Download first and last 1000 kb of a file? -
Download first and last 1000 kb of a file?Hi Can anyone tell me how I can download the first 1000 kb and last 1000 kb of a file in C#? When downloaded, the file should just be deleted. Have no clue on how to do this. Thanks in advance
-
Loop through and process every php code.Yeah.. I know regex's (I've been writing PHP's for years now :)). Just don't know how to do it in C#, I would do it like this in PHP: preg_match_all("#<? (.*?) ?>#si",$content,$matched);
modified on Friday, December 19, 2008 8:44 AM
-
Loop through and process every php code.Hi, I am currently writing a program to automaticly encrypt PHP code. Hovewer, I need to find every occurences of php code (<?|<?php //content ?>) and loop through the contents of this. So... If I for example enter the string:
Testing <? echo "test"; ?>
<? $variable = "another test"; echo $variable; ?> The script should find the two occurences of PHP code, and return them in two messageboxes. The first one should return MessageBox.Show("echo \"test\";"); etc. So, find the PHP tags, loop through them (a for loop, I assume), and then put the contents into a string variable (so I can just say MessageBox.Show(phpText);). Does anyone have a clue on how to do this? Thanks.
-
Average/dominating color in imageHey, Is is possible to find the average (dominating) color in an image. For example it there's mostly white in the image, it should Messagebox.Show("Average Color: #FFFFFF") or MessageBox.Show("Average Color: R=255 G=255 B=255). Thanks,
-
Find color in pixel.Thanks :) works perfect..
-
Find color in pixel.Hi, I got a code where I move the mouse around the screen... Everytime the mouse moves a pixel, i have an action. In that action, i want to find the color of the pixel there are in the screen position: 395,247... Just need the color in HEX (#xxxxxx) or RGB (xxx,xxx,xxx). Can anyone make an example for me to do that? Thanks.
-
Simulate mouseclick??Hi, Almost forgot to thank you! So.. Thanks! :) Nice code ;)
-
Simulate mouseclick??Hi, I want to send a mouseclick to a defined window in c#, without moving the cursor. It should just leftclick on a specified (X,Y) position on the screen. Can i do that without moving the cursor? And can it work if the target window is hidden/minimized? Hope someone can give me a code example :)
-
Place form 10px from right side of screen.Thanks to all. It works perfect now :)
-
Place form 10px from right side of screen.Hi, I want to place my windows form 10 pixels from the right side of my user's screen. But they have different screen resolutions, so i cant place it with a value in pixels. So do anyone know how to do it? I'm using this code on my form-load, to place the window:
this.Height = 175; this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height);
Thanks, Elias Sorensen -
Invisible countdown?Thanks to all :) Works perfect!
-
Invisible countdown?Hi, Can anyone make a quick example that shows how to countdown in time? I want to run a function every minute, so it needs to countdown in the background with no textoutput (where it shows the timer). Thanks.
-
Video to FLV with c#?Hi, I need a script to convert a video file to flv, with c#. I don't know how this could be made, is there a FFMPEG sdk or something for c#? Maybe a tutorial?
-
Open XML (Rss) file.Hi, I got a very simple XML file: Book title And want to have it printed in my c# application. It should open the xml file from my website (http://my-website.com/books.rss), and then echo what's inside . Can anyone make simple and lightweight code do do that?
-
How do i dock a window to the bottom of the screen?Works perfect! Thank you very much!
-
How do i dock a window to the bottom of the screen?Doesn't work when i'm doing this: this.Location = new Point(0, Screen.PrimaryScreen.WorkingArea.Height - this.Height); this.Width = Screen.PrimaryScreen.Bounds.Width; this.Height = 22; Have i made a mistake?
-
How do i dock a window to the bottom of the screen?It didn't work perfect, but i tried to use: this.Location = new Point(0, Screen.PrimaryScreen.Bounds.Height - (this.Height + 30)); And that works perfect. But! If i make the processbar bigger, it follows, but if i make it smaller, it is the same place as before, do you understand?
-
How do i dock a window to the bottom of the screen?Thanks! It is working! BUT! I could't find the window.. Because it was placed behind the process bar (it was only because I got aero, that i could see it). Do you know how to fix that?
-
How do i dock a window to the bottom of the screen?I've tried this: private void Form1_Load(object sender, EventArgs e) { this.Location = New Point(0, Screen.PrimaryScreen.Bounds.Height - thid.Height); this.Width = Screen.PrimaryScreen.Bounds.Width; } But I get an error ; expected. Sorry if I've done it wrong, only made c# in 2 days ;)