如何在oneDrive共享.txt文件中附加数据 [英] how to append data on the oneDrive shared .txt file

查看:183
本文介绍了如何在oneDrive共享.txt文件中附加数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 void create_file(string name,int score)
{
string path = @" D:\ visual studio projects \ packageman\packman.txt" ;;
if(!File.Exists(path))
{
using(StreamWriter SW = File.CreateText(path))
{
SW.WriteLine(name + "" +得分);
}
}
其他
{
使用(StreamWriter SW = File.AppendText(路径))
{
SW.WriteLine(" ; \ n" + name +"" + score);
}
}
}

它将写入文件 


但不会写在互联网 


或onedrive 


请帮助

解决方案

您好,


它比使用流式编写器更复杂。


https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting -started /?视图= ODSP-图形的在线


void create_file(string name,int score)
        {
            string path = @"D:\visual studio projects\packman\packman.txt";
            if (!File.Exists(path))
            {
                using (StreamWriter SW = File.CreateText(path))
                {
                    SW.WriteLine(name + " " + score);
                }
            }
            else
            {
                using (StreamWriter SW = File.AppendText(path))
                {
                    SW.WriteLine("\n" + name + " " + score);
                }
            }
        }

it will write on file 

but not on the internet 

or onedrive 

please help

解决方案

Hello,

It's more complex than using a stream writer.

https://docs.microsoft.com/en-us/onedrive/developer/rest-api/getting-started/?view=odsp-graph-online


这篇关于如何在oneDrive共享.txt文件中附加数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆