|
The think that I can see is BinaryReader is for reading but you create FileStream in ReadWrite mode,change it to Read mode,and for writng into create another stream. If it didn't solved then tell what error you encounter. Also in msdn there are some samples for writing into and reading from file in BinaryReader page,you can check it.
Mazy
No sig. available now.
|
|
|
|
|
That isn't so much the problem, but I'll certainly take your advice and use separate streams for reading and writing.
The issue I have is getting the content of the stream into a format that I can use something like regex on to do the search/replace.
I'll check the msdn site too...
Many thanks
|
|
|
|
|
Why don't you manipulate your excel file using Excel Automation?
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
m a y s a m wrote:
Why don't you manipulate your excel file using Excel Automation?
He said he is teaching himself C#,so maybe its just a practise for himself.
Mazy
No sig. available now.
|
|
|
|
|
|
That's the problem Jonathan - I cannot work out how to get the filestream into a format regex will work with.
|
|
|
|
|
Sorry about this lame answer. In fact, RegEx does not accept streams but only strings!
If it is an option, load the entire file to memory and the apply RegEx on it.
Jonathan de Halleux.
www.dotnetwiki.org
|
|
|
|
|
unfortunately loading the whole file seemed to take way too long.
|
|
|
|
|
Look at the next C++ code:
1) Defining map
const int cols=15;
struct stTot {
string strDesc;
double fTots[cols];
} myTot;
map<int, sttot=""> mpLis;
map<int, sttot="">::iterator it;
2) Loading map
int iCnt = 0;
myTot.strDesc = (LPCTSTR)some_string;
for (int v=0; j
|
|
|
|
|
Do me a favor and modify your post.
This time, click the "Do not treat <'s as HTML tags" checkbox.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
See System.Collections.Hashtable .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Does anyone know how i can send messages to other windows applications. For example to tell the media player to start playing a file.
|
|
|
|
|
|
To expand on what Niels said, you'll want to P/Invoke that API:
[DllImport("user32.dll")]
private static extern IntPtr SendMessage(
IntPtr hWnd,
uint msg,
IntPtr wParam,
IntPtr lParam); There are some shortcuts, too. If a param takes an address of a struct, rather than make several unsafe calls from the System.Runtime.InteropServices namespace, you can instead overload SendMessage . For instance, the TVM_SETITEM message for a TreeView Common Control (which System.Windows.Forms.TreeView encapsulates) requires the address of an <code>LPTVITEM for the lParam . You could overload SendMessage like so:
[DllImport("user32.dll")]
private static extern IntPtr SendMessage)
IntPtr hWnd,
uint msg,
IntPtr wParam,
ref LVITEM lvItem); You'll still have to define the LVITEM struct, but this is pretty easy to do. See more information about that in the StructLayoutAttribute documentation.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How can I get the list of the running applications in my PC,using C#?
Thanks
|
|
|
|
|
|
Thank you very much, but in the article you posted I only found how to get running processes, I need to get the applications, like in the first Window in Windows Task Manager.
I searched a lot in CodeProject, but I didn't find nothing really usefull.
Thanks anyway, the article is very interesting
|
|
|
|
|
What about this:
get the processes System.Diagnostics.Process.GetProcesses()
then show only the ones with MainWindowHandle != ItPtr.Zero
and check if they have a MainWindowTitle
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
ok, so how would you googlefish for an answer to the following screen scraper question:
how do i get a bitmap of a "virtual" control, that is what the control would look like but without showing it on the screen?
TIA!
________________________________________
Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain.
Then perhaps I'd deserve ya, and be even worthy of ya..
if I only had a brain!
|
|
|
|
|
|
Mazy, thanks. The question i want answered was eloquently stated re the article you sent (see below). Unfortunately there was no answer posted-- does anyone know the answer?
TIA!
HERE IS stantheman's question (and mine):
Greetings all,
I dig Agha Ali Raza’s article (Capturing the Screen Image in C#), but what I want to do is capture the image before it hits the screen.
How would I do this?
In essence, I would like to take a screen-shot (bitmap) of a Form *before* it ever gets to the screen.
If you’re interested, - what I want to do is perform a little “graphics-magic” on the image using GDI+ - I want to “dance” the image of the Form around the screen before I present the actual Form. And I don’t know how to do this. I’ve tried overloading the Form.OnPaint method, but I just don’t seem to be getting it right.
Anyone?
Thanks all,
- Stan Shankman
http://www.codeproject.com/csharp/csCaptureScreen1.asp?msg=435733#xx435733xx
________________________________________
Gosh, it would be awful pleas'n, to reason out the reason, for things I can't explain.
Then perhaps I'd deserve ya, and be even worthy of ya..
if I only had a brain!
|
|
|
|
|
Hi, what the best compiler for C and C++?
(for compile the projects in this site....)
|
|
|
|
|
See the title above this page: C#
You should post in VC++ forum.
Mazy
No sig. available now.
|
|
|
|
|
OK, and, what the best for C#?
|
|
|
|
|
You missed the point. C# is not like C or c++ which could have different compiler. C# and all other supported .NET language like VB.NET have the same compiler. Its nothing to deal with C or C++.You should ask in VC++ forum the best C or C++ compiler.
Mazy
No sig. available now.
|
|
|
|