how to create file

hi

how to create a file at sd or mmc card

The develop platform is c# .net cf 2.0.

the sample code is better.

thank you



Answer this question

how to create file

  • Agent Graves

    I was going to post that... :-)

    Ilya - is there some class (like driveinfo) for the .NET CF that we can use to determine if there is a storage card available



  • Octopus384

    For Each directory As String In System.IO.Directory.GetDirectories("\") ' Enumerating all subfolders in a root folder...

    If ((New System.IO.DirectoryInfo(directory)).Attributes And IO.FileAttributes.Temporary) <> 0 Then ' Picking folders with Temporary attribute set...

    Console.WriteLine("Found storage card: {0}", directory)

    End If

    Next



  • ikarkaroff

    sorry, I looked at the original author using c# and thought that was what it was. thanks

  • maqk

    hi ahmedilyas

    how to know whether the storage card is exist

    if the storage card does not be fixed at the handset.

    create file at storage card fold maybe exception

    Thank you


  • jiggs

    You should enumerate storage cards. That can be done by enumerating all subfolders in a root folder and picking folders with Temporary attribute set.



  • IntMain

    No, but temporary attribute on folders in root folder works fine.



  • Jeroen ter Heerdt

    that is VB.NET code

  • Becky N

    does anyone have sample code to do this in vb

  • papadi

    Ilya

    I do not understand what you said clearly,

    Can you paste some sample code to let us know it.

    Thank you


  • Scott Simms

    Does this help



    StreamWriter theWriter = new StreamWriter("\\Storage Card\\someFolder\\SomeFile.txt");
    theWriter.Write("hi");
    theWriter.Close();

    be sure to use the System.IO namespace to access the Stream(writer) classes



  • how to create file