File.write全部文字问题 [英] File.write All text issue

查看:91
本文介绍了File.write全部文字问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

Dear Friends,

File.WriteAllText(ev.FullPath, File.ReadAllText(ev.FullPath, Encoding.Default), Encoding.UTF8); 



此功能在我的本地计算机上运行良好,但是当我将应用程序放入服务器时,它将读取文件,但写入一个空字符串.

可能是什么问题.

问候



This function works fine in my local machine but when i put the application in the server it reads the file but writing an empty string.

what could be the issue.

regards

推荐答案

机会是ReadAllText失败了,而不是WriteAllText失败了.检查文件路径以确保文件存在,并且服务器进程的用户已登录,并且具有对包含该文件的文件夹的读取权限.
The chances are that the ReadAllText is failing, rather than the WriteAllText. Check the file path to make sure the file exists, and that the user the server process is logged in as has read access to the folder containing the file.


这篇关于File.write全部文字问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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