﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
   <CodeSnippet Format="1.0.0">
        <Header>
            <Title> Determining the size of a file </Title>
            <Description> Expansion snippet for determining the size of a file. </Description>
            <Author>Microsoft Corporation</Author>
            <SnippetTypes>          
                <SnippetType> Expansion </SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID> FileName </ID>
                    <Default> strFileName </Default>
                    <ToolTip> Variable to hold the file name. </ToolTip>
                </Literal>
            </Declarations>
            <Code Language="vjsharp" Format="CData"><![CDATA[
long lFileSize = 0; // Variable to hold the file size

//Check if the file name is not null and not blank
if ($FileName$ != null && $FileName$.length() > 0)
{
    java.io.File objFile = new java.io.File($FileName$);
    lFileSize = objFile.length();
}

$selected$ $end$
]]>
</Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
