473,511 Members | 13,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

2 questions

I'm creating a file compare app,(I know about windif) but i'm creating my
own, to add my own features.
I have several questions I'm stuck with to finish up my app.

1. I have a message box that is displayed with a OK and Cancel buttons. If
the user clicks OK I want to open the 2 different files. How can I determine
if the user clicks OK?

2. If OK is clicked I want to open both files the user is comparing and
display the contents of the file. How can I open the files to read? the
files will open in notepad of course.

I know theres windif, and other file compare tools, but i'm creating my own
to get a better understanding of what C# can do, and since we have a in
house source code managment tool, it has no file compare feature to it.
Nov 15 '05 #1
8 1258
Hi Mike,
"Mike" <cs*********@sbcglobal.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...
I'm creating a file compare app,(I know about windif) but i'm creating my
own, to add my own features.
I have several questions I'm stuck with to finish up my app.

1. I have a message box that is displayed with a OK and Cancel buttons. If the user clicks OK I want to open the 2 different files. How can I determine if the user clicks OK?
The return value of MessageBox.Show:

if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel) ==
DialogResult.OK)
2. If OK is clicked I want to open both files the user is comparing and
display the contents of the file. How can I open the files to read? the
files will open in notepad of course.


How you will show the comparision if you show each file in notepad?
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 15 '05 #2
100
Hi Mike,
1. I have a message box that is displayed with a OK and Cancel buttons. If the user clicks OK I want to open the 2 different files. How can I determine if the user clicks OK?

If you use the MessageBox class its Show method returns DialogResult value
that carries the information about which button has been clicked

if(DialogResult.OK == MessageBox.Show(....))
{
//'Ok' button has been clicked on
}

B\rgds
100
Nov 15 '05 #3
at this time i'm not sure how to show the comparisions. Once I get the files
opened and displaying the contents in notepad I'll be happy, then I can
figure out how to show the compares
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:un**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,
"Mike" <cs*********@sbcglobal.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...
I'm creating a file compare app,(I know about windif) but i'm creating my own, to add my own features.
I have several questions I'm stuck with to finish up my app.

1. I have a message box that is displayed with a OK and Cancel buttons.

If
the user clicks OK I want to open the 2 different files. How can I

determine
if the user clicks OK?


The return value of MessageBox.Show:

if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel) ==
DialogResult.OK)
2. If OK is clicked I want to open both files the user is comparing and
display the contents of the file. How can I open the files to read? the
files will open in notepad of course.


How you will show the comparision if you show each file in notepad?
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nov 15 '05 #4
Hi Mike,

Well the whole point of a windif 's like program is that, how to show the
differences, you will have to show it yourself, not using notepad.

you don't need to open the files to display them in notepad, a sinple call
to Process.Start("c:\winnt\notepad " + filename ); can do it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:ug**************@TK2MSFTNGP12.phx.gbl...
at this time i'm not sure how to show the comparisions. Once I get the files opened and displaying the contents in notepad I'll be happy, then I can
figure out how to show the compares
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:un**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,
"Mike" <cs*********@sbcglobal.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...
I'm creating a file compare app,(I know about windif) but i'm creating my own, to add my own features.
I have several questions I'm stuck with to finish up my app.

1. I have a message box that is displayed with a OK and Cancel buttons.
If
the user clicks OK I want to open the 2 different files. How can I

determine
if the user clicks OK?


The return value of MessageBox.Show:

if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel) ==
DialogResult.OK)
2. If OK is clicked I want to open both files the user is comparing

and display the contents of the file. How can I open the files to read? the files will open in notepad of course.


How you will show the comparision if you show each file in notepad?
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Nov 15 '05 #5
OK, thanks
I'm going one step at a time with this
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OG**************@TK2MSFTNGP11.phx.gbl...
Hi Mike,

Well the whole point of a windif 's like program is that, how to show the
differences, you will have to show it yourself, not using notepad.

you don't need to open the files to display them in notepad, a sinple call
to Process.Start("c:\winnt\notepad " + filename ); can do it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:ug**************@TK2MSFTNGP12.phx.gbl...
at this time i'm not sure how to show the comparisions. Once I get the

files
opened and displaying the contents in notepad I'll be happy, then I can
figure out how to show the compares
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>

wrote
in message news:un**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,
"Mike" <cs*********@sbcglobal.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...
> I'm creating a file compare app,(I know about windif) but i'm creating
my
> own, to add my own features.
> I have several questions I'm stuck with to finish up my app.
>
> 1. I have a message box that is displayed with a OK and Cancel buttons. If
> the user clicks OK I want to open the 2 different files. How can I
determine
> if the user clicks OK?

The return value of MessageBox.Show:

if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel)
== DialogResult.OK)

> 2. If OK is clicked I want to open both files the user is comparing

and > display the contents of the file. How can I open the files to read? the > files will open in notepad of course.
>

How you will show the comparision if you show each file in notepad?
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



Nov 15 '05 #6
I tried that line to see how it works, and it errors out.

unrecognized escape sequence.

what does that mean?

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OG**************@TK2MSFTNGP11.phx.gbl...
Hi Mike,

Well the whole point of a windif 's like program is that, how to show the
differences, you will have to show it yourself, not using notepad.

you don't need to open the files to display them in notepad, a sinple call
to Process.Start("c:\winnt\notepad " + filename ); can do it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:ug**************@TK2MSFTNGP12.phx.gbl...
at this time i'm not sure how to show the comparisions. Once I get the

files
opened and displaying the contents in notepad I'll be happy, then I can
figure out how to show the compares
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>

wrote
in message news:un**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,
"Mike" <cs*********@sbcglobal.net> wrote in message
news:el**************@TK2MSFTNGP12.phx.gbl...
> I'm creating a file compare app,(I know about windif) but i'm creating
my
> own, to add my own features.
> I have several questions I'm stuck with to finish up my app.
>
> 1. I have a message box that is displayed with a OK and Cancel buttons. If
> the user clicks OK I want to open the 2 different files. How can I
determine
> if the user clicks OK?

The return value of MessageBox.Show:

if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel)
== DialogResult.OK)

> 2. If OK is clicked I want to open both files the user is comparing

and > display the contents of the file. How can I open the files to read? the > files will open in notepad of course.
>

How you will show the comparision if you show each file in notepad?
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



Nov 15 '05 #7
Hi Mike,

It means that I typed it in OE :)
remember that you need to escape the \ character in a string:

Process.Start( @"c:\winnt\notepad.exe" + filename );

Will solve that, but please remember that it was just for show you how you
could do it, I haven't even tested if notepad is really in c:\winnt

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
I tried that line to see how it works, and it errors out.

unrecognized escape sequence.

what does that mean?

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote in message news:OG**************@TK2MSFTNGP11.phx.gbl...
Hi Mike,

Well the whole point of a windif 's like program is that, how to show the
differences, you will have to show it yourself, not using notepad.

you don't need to open the files to display them in notepad, a sinple call to Process.Start("c:\winnt\notepad " + filename ); can do it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:ug**************@TK2MSFTNGP12.phx.gbl...
at this time i'm not sure how to show the comparisions. Once I get the files
opened and displaying the contents in notepad I'll be happy, then I can figure out how to show the compares
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>

wrote
in message news:un**************@TK2MSFTNGP10.phx.gbl...
> Hi Mike,
>
>
> "Mike" <cs*********@sbcglobal.net> wrote in message
> news:el**************@TK2MSFTNGP12.phx.gbl...
> > I'm creating a file compare app,(I know about windif) but i'm creating my
> > own, to add my own features.
> > I have several questions I'm stuck with to finish up my app.
> >
> > 1. I have a message box that is displayed with a OK and Cancel

buttons.
> If
> > the user clicks OK I want to open the 2 different files. How can I
> determine
> > if the user clicks OK?
>
> The return value of MessageBox.Show:
>
> if ( MessageBox.Show( "Text", "Caption",
MessageBoxButtons.OKCancel) == > DialogResult.OK)
>
> > 2. If OK is clicked I want to open both files the user is

comparing and
> > display the contents of the file. How can I open the files to
read? the
> > files will open in notepad of course.
> >
>
> How you will show the comparision if you show each file in notepad?
>
>
> Cheers,
>
> --
> Ignacio Machin,
> ignacio.machin AT dot.state.fl.us
> Florida Department Of Transportation
>
>



Nov 15 '05 #8
ok, thanks.
I understand it was for show, but it put on the right path
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:OF**************@TK2MSFTNGP12.phx.gbl...
Hi Mike,

It means that I typed it in OE :)
remember that you need to escape the \ character in a string:

Process.Start( @"c:\winnt\notepad.exe" + filename );

Will solve that, but please remember that it was just for show you how you
could do it, I haven't even tested if notepad is really in c:\winnt

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:uL**************@TK2MSFTNGP10.phx.gbl...
I tried that line to see how it works, and it errors out.

unrecognized escape sequence.

what does that mean?

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us>

wrote
in message news:OG**************@TK2MSFTNGP11.phx.gbl...
Hi Mike,

Well the whole point of a windif 's like program is that, how to show the differences, you will have to show it yourself, not using notepad.

you don't need to open the files to display them in notepad, a sinple call to Process.Start("c:\winnt\notepad " + filename ); can do it.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Mike" <cs*********@sbcglobal.net> wrote in message
news:ug**************@TK2MSFTNGP12.phx.gbl...
> at this time i'm not sure how to show the comparisions. Once I get the files
> opened and displaying the contents in notepad I'll be happy, then I can > figure out how to show the compares
>
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
> in message news:un**************@TK2MSFTNGP10.phx.gbl...
> > Hi Mike,
> >
> >
> > "Mike" <cs*********@sbcglobal.net> wrote in message
> > news:el**************@TK2MSFTNGP12.phx.gbl...
> > > I'm creating a file compare app,(I know about windif) but i'm

creating
> my
> > > own, to add my own features.
> > > I have several questions I'm stuck with to finish up my app.
> > >
> > > 1. I have a message box that is displayed with a OK and Cancel
buttons.
> > If
> > > the user clicks OK I want to open the 2 different files. How can I > > determine
> > > if the user clicks OK?
> >
> > The return value of MessageBox.Show:
> >
> > if ( MessageBox.Show( "Text", "Caption", MessageBoxButtons.OKCancel)
==
> > DialogResult.OK)
> >
> > > 2. If OK is clicked I want to open both files the user is

comparing and
> > > display the contents of the file. How can I open the files to read? the
> > > files will open in notepad of course.
> > >
> >
> > How you will show the comparision if you show each file in notepad? > >
> >
> > Cheers,
> >
> > --
> > Ignacio Machin,
> > ignacio.machin AT dot.state.fl.us
> > Florida Department Of Transportation
> >
> >
>
>



Nov 15 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4071
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for...
0
4557
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
7154
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
4
2494
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
8
7958
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying...
0
1473
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
1
1601
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
4468
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
3411
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
2918
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
7144
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7427
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7085
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7512
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.