How to create a file in application data local folder which is not hidden in windows store app?

I want to create a log file in ApplicationData local folder.
     m_StorageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(m_Name.Replace(" ", "_") + ".log",
                          CreationCollisionOption.OpenIfExists);
First time when my app is launched, the file gets created and logs are written.
When I close my app, and re run the app once again, the log file that was created is now hidden and when i try to call
the code :    m_StorageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(m_Name.Replace(" ", "_") + ".log",
                          CreationCollisionOption.OpenIfExists);
m_StorageFile is NULL.
How can i prevent the file from becoming Hidden or ReadOnly.
Thanks

Here is a very simple sample that works fine.  Start with this and see what you are doing different.
XAML:
<Page
x:Class="LocalStorage.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:LocalStorage"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Loaded="Page_Loaded">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBox x:Name="outputTxt" HorizontalAlignment="Left" Margin="76,82,0,0" TextWrapping="Wrap" VerticalAlignment="Top" AllowDrop="True" PlaceholderText="No Data read from local file" Width="791"/>
<Button Content="Store Data" HorizontalAlignment="Left" Margin="73,145,0,0" VerticalAlignment="Top" Click="Button_Click" />
</Grid>
</Page>
C#
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.Storage;
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;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace LocalStorage
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
public MainPage()
this.InitializeComponent();
private async void Button_Click(object sender, RoutedEventArgs e)
if (m_StorageFile != null)
try
string userContent = outputTxt.Text;
if (!String.IsNullOrEmpty(userContent))
await FileIO.WriteTextAsync(m_StorageFile, userContent);
else
// should be some info to write
catch (FileNotFoundException)
// do something
private StorageFile m_StorageFile;
private async void createFileOrGetFile()
m_StorageFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("sample.log", CreationCollisionOption.OpenIfExists);
private async void Page_Loaded(object sender, RoutedEventArgs e)
createFileOrGetFile();
if (m_StorageFile != null)
try
string fileContent = await FileIO.ReadTextAsync(m_StorageFile);
outputTxt.Text = fileContent;
catch (FileNotFoundException)
// do something!
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions
@WSDevSol
Getting Started With Windows Azure Mobile Services development?
Click here
Getting Started With Windows Phone or Store app development?
Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)

Similar Messages

  • How can we get a url for a "Meet Now" conference call from within the Windows Store App?

    Hi,
    Is it possible to get the url for the current meeting / new "Meet Now" call from within the Windows Store app?
    You have the option of inviting your current Lync contacts, but I don't see a way of giving a URL to clients that would launch Lync on their device, or take them to the web app.
    I can see how to get the link using the Outlook plugin, for pre-scheduled meetings. Is this link always the same and the one that should be used for an impromptu "Meet Now" meeting? It would still be good to know how to get this URL from within
    the store app so I can tell clients where to get it.
    Some people may be on Windows RT devices and not have access to the plugin in Outlook, and want to start a meeting at short notice and then invite others via email or pasting a link to them elsewhere.
    Any help appreciated.
    If I have answered your question, please mark it as the correct answer. If I have provided helpful information, please mark it as so.

    Hi,
    Agree with Holger, I check on my Lync Windows Store app and can't find the meeting URL as well.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • How to create a report for open sales orde documents which are not invoiced

    Hi Experts this is urgent,
    +pls give the Logic for document flow+
    My requirement is create a report for sales orders which are not invoiced  using the following table.
    VBAK : sales order header
    VBAP : sales order item
    VBFA : sales document flow
    VBUK for processing status
    KOMV for duties value and sales order value
    LIKP : delivery not header
    LIPS :delivery note item
    For information : In the header level the processing Status is indicated in the table VBUK field LFSTK for one sales order number. A,B , C are the possible entries.
    Case A : When a sales order is invoiced we can display information on the header status :
    Overall status : Completed  and display a invoice number in the document flow. When the items of the sales orders are invoiced the process status is the following :  Overall status       Completed            
    Delivery status      Fully delivered      
    Case B : An open sales order not delivered and not invoiced will have overall status : Open on the header and item level and will not have subsequent documents.
    Case C :
    When the items for the sales order are delivered but not invoiced the status will be u201Cfully deliveredu201D
    And the subsequent documents will be delivery notes and good issue if the delivery note is issued.
    With regards
    ravi
    Edited by: ravik ravik on Jun 25, 2008 3:29 PM

    Hello Ravi,
    U neednot develop any report..
    there is std report with txn V.02
    or copy this and make necessary changes.
    Reward, if helpful.
    Rgds,
    Raghu.

  • Creating a file saving application

    Can someone tell how to create a file saving application. i.e. an applicaiton that takes a file from one destination and saves it at another. I know I will have to use an instance of FileOutputStream to create the new file, but do I need to use FileInputStream to read the bytes of the file first, before writing it?
    I would be grateful if anyone could help, as i am fair begginer at Java. Cheers.

    Actually streams are more appropriate here. Only use Reader and Writer if you are sure that your file is a text file. Beyond that, it is inefficient to keep calling readLine. Read in a big chunk with a buffer instead.
    You would have to do this:
    BufferedReader in = new BufferedReader(new
    FileReader("input.txt"));
    PrintWriter out = new PrintWriter(new
    FileWriter("out.txt"));
    while(true)
    String line = in.readLine();
    if(line == null)
    break;
    out.println(line);
    in.close();
    out.close();For more programming help, visit
    http://www.NeedProgrammingHelp.com or email me
    at [email protected]

  • How to use local .sdf database in a windows store apps

    Hi,
    I am new in windows store app development. I have been working in WPF application development for long time. Now I want develop windows store apps. I am studying on it. I got a problem. I what to store data from windows store app in .sdf database file. I
    confused is .sdf database is compatible with windows store apps.
    I want Deploy the apps in windows apps store. Is .sdf database support in client machine while he download it and run his own machine.
    Please Suggest me about it with sample reference. It will be very helpful for me.
    bye
    With Regards
    Sadequzzaman Monoj
    Bangladesh

    SDF files are used by Microsoft SQL Server Compact Edition. SQL CE is not supported for Windows Store Apps/Universal Apps. Only WP Silverlight Apps can use SQL CE. You will have to switch to a different database format.
    As far as I know the only DB currently supported for local deployment with Windows Store Apps is SQLite.
    This article gives an introduction on how to get started with SQLite in Universal Apps:
    http://blog.tpcware.com/2014/04/universal-app-with-sqlite-part-1/

  • How to use .sdf database in a windows store apps

    Hi,
    I am new in windows store app development. I have been working in WPF application development for long time. Now I want develop windows store apps. I am studying on it. I got a problem. I what to store data from windows store app in .sdf database file. I
    confused is .sdf database is compatible with windows store apps.
    I want Deploy the apps in windows apps store. Is .sdf database support in client machine while he download it and run his own machine.
    Please Suggest me about it with sample reference. It will be very helpful for me.
    bye
    With Regards
    Sadequzzaman Monoj
    Bangladesh

    SDF files are used by Microsoft SQL Server Compact Edition. SQL CE is not supported for Windows Store Apps/Universal Apps. Only WP Silverlight Apps can use SQL CE. You will have to switch to a different database format.
    As far as I know the only DB currently supported for local deployment with Windows Store Apps is SQLite.
    This article gives an introduction on how to get started with SQLite in Universal Apps:
    http://blog.tpcware.com/2014/04/universal-app-with-sqlite-part-1/

  • How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!

    How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!
    I want to know how to create a backup file (because I'm pretty new with itunes, and it's hard to use it for me still), how to store my app data/media/videos, etc. And how I can retrieve them back when I'm done with the app I tried on my friend's computer.
    If anyone can help, it'd be great! Thank you so much!

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • How to create a file under web application root from java program

    how to create a file under web application root from java program like an action class?

    like an action class?Huh? What exactly is your requirement?
    Creating a file is usually done with java.io API. Read the java.io tutorials how to play with files.

  • How do I create rules files in Sap Data Services

    Hello Guys,
    I'm new with Bo Sap Development Data Services, and am migrating SSIS packages 2008 for the bods.
    I am studying the process of cleanup and word processing via bods.
    But I noticed that my installation does not have Rules Files.
    My question is:
    How do I create rules files in Sap Data Services library with support for Portuguese?

    Hello Ramana,
    So with version 4.2 of Sap Data Services do not currently have the rules files?
    How to mount files for text comparison Cleanse facing Addresses, Names, Clients, Companies? If you can give me some help link?
    Thanks again ...

  • How to create pdf files with text field data

    how to create pdf files with text field data

    That looks like it should work, but it doesn't.
    I opened the PDF I had created from Word in Acrobat (X Pro). Went to File > Properties. Selected "Change Settings". I then enabled "Restrict editing...", set a password, set "Printing Allowed" to "none", "Changes Allowed" to "none", and ensured that "Enable copying of text..." was disabled.
    I saved the PDF file, closed Acrobat, opened the PDF in Reader, and I was still able to select text and graphical objects.
    I reopened the PDF in Acrobat, and the document summart still shows everything as allowed. When I click on "show details" (from File > Properties) it shows the correct settings.
    Any ideas?

  • How to create a file in memory and then store it in database

    Hi Guys,
    I'm wondering how could i create a file such a plain text or css styleshhet in runtime and then store this file in the database. I need to save them in the database cause the application doe not have write permission to filesystem.
    Is that possible ? Can a file be created only in memory and saved in database instead of filesystem?
    I'd appreciate your help on this.
    Thanks a lot.

    jack.black wrote:
    What i really need is to save information as a stylesheet into db. These information is input in a form and sent to a servlet. You have a servlet and in there you are creating data, lets say the data is representable as a string.
    You have a database layer (however it is implemented) which takes data (string) and stores it as a blob presumably.
    That is two distinct and completely separate processes.
    The second has nothing to do with the first because the second doesn't care how the data is created. And you should write the code for the second and test it completely independent from the first (just as all of the database layer should be handled.)
    As for the first you can use StringWriter, perhaps wrapping it in PrintWriter if you wish. Do whatever you want to put data in there. Be sure to close it, extract the string and then use it.
    The only limitation to processing like this is that if the data gets too large (individually or due to number of threads) it could adversely impact the application.

  • Need how to create DTD file  for database elements

    can any one write the DTD file for below query?
    SELECT TRX_NUMBER,
    INVOICE_CURRENCY_CODE,
    CTT_TYPE_NAME ,
    RAC_BILL_TO_CUSTOMER_NAME ,
    FROM APPS.RA_CUSTOMER_TRX_PARTIAL_V V
    DTD file structure For below query(data from two tables) also?
    SELECT TRX_NUMBER,
    INVOICE_CURRENCY_CODE,
    CTT_TYPE_NAME ,
    RAC_BILL_TO_CUSTOMER_NAME ,
    V.RAT_TERM_NAME
    FROM APPS.RA_CUSTOMER_TRX_PARTIAL_V V,APPS.RA_CUST_TRX_TYPES_ALL H
    WHERE V.CUST_TRX_TYPE_ID=H.CUST_TRX_TYPE_ID;
    DTD file structure For below program (Data should be come in that loop formate (1st c1 loop then 2nd loop details then 1st loop)
    DECLARE
    cursor c1 is SELECT TRX_NUMBER,
    CUSTOMER_TRX_ID,
    INVOICE_CURRENCY_CODE,
    CTT_TYPE_NAME ,
    RAC_BILL_TO_CUSTOMER_NAME ,
    V.RAT_TERM_NAME
    FROM APPS.RA_CUSTOMER_TRX_PARTIAL_V V,APPS.RA_CUST_TRX_TYPES_ALL H
    WHERE V.CUST_TRX_TYPE_ID=H.CUST_TRX_TYPE_ID;
    cursor c2(P_CUSTOMER_TRX_ID number) is SELECT CL.INTERFACE_LINE_ATTRIBUTE1 ,
    CL.CUSTOMER_TRX_LINE_ID,
    MTL.SEGMENT1,
    MTL.DESCRIPTION
    FROM APPS.RA_CUSTOMER_TRX_LINES_V CL,
    APPS.MTL_SYSTEM_ITEMS_B MTL
    WHERE MTL.INVENTORY_ITEM_ID(+)=CL.INVENTORY_ITEM_ID
    AND MTL.ORGANIZATION_ID(+) = CL.WAREHOUSE_ID
    and cl.CUSTOMER_TRX_ID=P_CUSTOMER_TRX_ID
    BEGIN
    FOR I IN C1 LOOP
    DBMS_OUTPUT.PUT_LINE(I.TRX_NUMBER||I.CUSTOMER_TRX_ID||INVOICE_CURRENCY_CODE);
    FOR J IN C1(I.CUSTOMER_TRX_ID) LOOP
    DBMS_OUTPUT.PUT_LINE(J.INTERFACE_LINE_ATTRIBUTE1 ||J.CUSTOMER_TRX_LINE_ID||J.SEGMENT1);
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(I.RAC_BILL_TO_CUSTOMER_NAME);
    END LOOP;
    END;

    how to create batch file for windows application ??
    I hava 2 jar files
         1) b.jar (not have main class)
         2) a.jar (have main class and dependent on b.jar)
    so how i call main class of a.jar     ??Just set the main class in the manifest of a.jar and make sure the manifest knows about b.jar
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

  • How to create the file on a location where user having rights?

    Hi,
    I have requirement, in my application a lot program thatcreating a report in a file and it is written into a user location. Now it specified directly like ( c:\ or d:\......).
    The problem is that the user doesn't have rights to access that directories. What i suggest or feel i want to create that particular reports on a location where the end user having rights.
    Basically in Windows system %userprofiles% having right to do anyting. Suppose the OS installed in C: the %userprofiles% c:\documents and settings\username or D: then D:\Document and settings\username.
    How to achieve this please help me.
    Good help will be appreciated.
    kanish

    Hello,
    The best practice would be to create the file in My Documents for the current connected user to the windows.
    Unfortunately, you did not mention your forms version. In older version like 6.x there is function in d2kwutil library called Read_Registry in win_api_environment section and in latest versions the same function availble in webutil library with client_ name.
    So, you can read the registery for current connected user by using the above mentioned function from the following path of registry.
    My Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
    There is an entry called Personal. Read the path from that entry at runtime while generating/saving file to the client's location and save the file into that path.
    -Ammad

  • How to create txt file in utf-8?

    Hi,
    if i create a txt file using vb in fdm, it is created with the ansi encoding. Is there any option how to create this file in utf-8?
    Thx

    Forms6i uses Oracle 8.0.6 client libraries. MetaLink Note 207303.1 lists supported client/server configurations, and the last database version supported with those libraries is Oracle 9.2. The only exception is made for e-Business Suite (Oracle Applications). Therefore, you configuration is not supported.
    Anyway, Oracle 8.0.6 does not support AL32UTF8 well. You should select UTF8 as the database character set (not national character set!). You need to select a check box on DBCA interface (possibly unavailable in fast/default installation path) which allows you to see non-recommended character sets.
    -- Sergiusz

  • Problem in creating a file on Application Server

    Hi,
    I am facing an issue while creating a file on the application server.
    I am creating a file with sales data from SAP and saving it on the application server.
    At the end of this operation, I am calling a Unix script to push this file from SAP to an external system.
    The issue I am facing is - at every month end, when I run a job for creating the file (its a custom program which is scheduled to run periodically), I get a strange scenario where a BLANK FILE gets created on the application server even though the data tables are not blank.
    Also the user id gets changed to UID = 1400 when I run this job for the first time when a BLANK FILE gets created.
    When I delete this file and run the job again, though, the file gets created WITH DATA.
    The user name remains DEVADM (Dev Admin), as it should be for the scheduled jobs.
    What could be the possible reasons for this?
    Please help me in this direction.
    Thank you.
    Regards,
    Keerthi

    Hi,
    You are using OPEN DATASET ? And what is the sy-subrc ?
    Can you post some lines of your code?
    Best regards,
    Leandro Mengue

Maybe you are looking for

  • 5 days old iPhone 5 iOS 6.1.4 battery life please help

    My phone is 5 days old and i am so fed up with battery life. I disabled all data settings and location services and i have nothing in notification center for any push notification. But still i lost 40% of the battery in half a day with just 5 mins of

  • Server-Side Includes screw up my design screen in Dreamweaver

    I have a .html file (which resides in my include folder) that was generated by an external program (one the merges and filters RSS files). I've created an .asp page and pull the .html file in using <!--#include file="include/RSS-Headline.html" --> It

  • Read idoc from archive in program

    Hi All,   I want to read the idoc from the archive in the program. Please suggest the possible options. we can read the idoc present in the R/3 database using the FM idoc_read_completely. But how to read the same from the archive. I can view the idoc

  • How to avoid multiple login option?

    When Solution Manager 4.0 is making RFC connection to ECC 6.0  it asks for login to particular user 4 to 5 times (on ECC). How can I avoid this option? Regards, Amit

  • Why are Sony ads SO FRIGGIN LOUD??!!

    I don't mind the ads much. Spotify does a good job spacing them out so you get a couple ads ever couiplafew songs - so much better than radio where you get 5 minutes of straight ads. ugh...  But why is it all the SONY ads are TWICE AS LOUD AS EVERYTH