Re: Packing a C# project.
"Neil Munro" <[email protected]>
| Newsgroups | gmane.comp.autopackage.devel |
|---|---|
| Message-ID | <[email protected]> |
So this
public void vCreateLogFile( )
{
try
{
if ( !File.Exists( "update.xml" ) )
{
FileStream fsLogFile = new FileStream( "update.xml",
FileMode.OpenOrCreate, FileAccess.Write );
StreamWriter swLog = new StreamWriter( fsLogFile );
swLog.WriteLine( "<?xml version=\"1.0\"
encoding=\"utf-8\" standalone=\"yes\"?>" );
swLog.Close( );
swLog.Dispose( );
fsLogFile.Close( );
fsLogFile.Dispose( );
}
}
catch ( Exception ex )
{
Console.WriteLine( ex.Message + "." );
}
}
Would look like this?
public void vCreateLogFile( )
{
try
{
if ( !File.Exists( BinReloc.DataDir( "update.xml" ) ) )
{
FileStream fsLogFile = new FileStream( BinReloc.DataDir(
"update.xml" ), FileMode.OpenOrCreate, FileAccess.Write );
StreamWriter swLog = new StreamWriter( fsLogFile );
swLog.WriteLine( "<?xml version=\"1.0\"
encoding=\"utf-8\" standalone=\"yes\"?>" );
swLog.Close( );
swLog.Dispose( );
fsLogFile.Close( );
fsLogFile.Dispose( );
}
}
catch ( Exception ex )
{
Console.WriteLine( ex.Message + "." );
}
}
Right?
2008/6/4 Jan Niklas Hasse <[email protected]>:
> On Wed, Jun 4, 2008 at 7:00 PM, Neil Munro <[email protected]> wrote:
> > Ok, I have included the cs file with no problem and changed the namespace
> to
> > be my project, which I believe is required, but that is my somewhat
> limited
> > experience.
> >
> > So every time I need to access a file regardless of what it is I create
> the
> > BinReloc object and call binreloc.DataDir("path/to/file");
> >
> > right?
>
> Yes, but you don't need to create an object as all functions are static.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: autopackage-dev-unsubscribe-OfajU3CKLf1/[email protected]
> For additional commands, e-mail: autopackage-dev-help-OfajU3CKLf1/[email protected]
>
>