vb.net - Write and read to text file on usb drive in Windows iot -
i have raspberry pi 3 windows iot core on it. i'm making app visual studio 2017.
i want read , write textfile on usb drive connected pi.
i looked around site , find same question of them don't work me.
this have!!
the mainpage
imports windows.storage imports windows.devices.usb imports windows.devices.enumeration public notinheritable class mainpage inherits page protected overrides sub onnavigatedto(e navigationeventargs) opendeviceasync() end sub private async sub opendeviceasync() dim externaldevices storagefolder = knownfolders.removabledevices dim externaldrives ireadonlylist(of storagefolder) = await externaldevices.getfoldersasync() dim sdcard storagefolder = externaldrives(0) if sdcard isnot nothing dim storagefolder storagefolder = knownfolders.removabledevices dim samplefile storagefile = await sdcard.createfileasync("sample.txt", creationcollisionoption.replaceexisting) end if end sub end class
the package.appxmanifest file addes usb capability
<capabilities> <capability name="internetclient" /> <uap:capability name="removablestorage" /> <devicecapability name="serialcommunication"> <device id="any"> <function type="name:serialport" /> </device> </devicecapability>
and .txt extension
<extensions> <uap:extension category="windows.filetypeassociation"> <uap:filetypeassociation name="text"> <uap:supportedfiletypes> <uap:filetype>.txt</uap:filetype> </uap:supportedfiletypes> </uap:filetypeassociation> </uap:extension> </extensions>
then when want start app thru remote machine on pi 3, visual studio stops , give's following page "app.g.i.vb" text in yellow
#if debug andalso not disable_xaml_generated_break_on_unhandled_exception addhandler me.unhandledexception, sub(sender global.system.object, unhandledexceptionargs global.windows.ui.xaml.unhandledexceptioneventargs) if global.system.diagnostics.debugger.isattached global.system.diagnostics.debugger.break() <----- yellow end if end sub #end if
can maby me please. in future want read .jpg files usb storage
Comments
Post a Comment