Please Help mecreate a new file with the name "samples.txt" - Raspberry Pi Forums


i know why following code gives me error, intention create new file name "samples.txt" in local folder of application, here have complete code:
using system;
using system.collections.generic;
using system.io;
using system.linq;
using system.runtime.interopservices.windowsruntime;
using windows.foundation;
using windows.foundation.collections;
using windows.ui.xaml;
using windows.ui.xaml.controls;
using windows.ui.xaml.controls.primitives;
using windows.ui.xaml.data;
using windows.ui.xaml.input;
using windows.ui.xaml.media;
using windows.ui.xaml.navigation;
using windows.storage;

namespace manipulating_files
{
public sealed partial class mainpage : page
{
private storagefolder folder = applicationdata.current.localfolder;
private storagefile file ;

public mainpage()
{
this.initializecomponent();
file = await folder.createfileasync("example.txt", creationcollisionoption.openifexists);
}
}
}

visual studio gives me following error:
'await' operator can used within async method. consider marking method 'async' modifier , changing return type 'task'.

please can edit post , use code tags, thank ;)


raspberrypi



Comments