将表单结果写入服务器上的TXT文件 [英] Writing form results to a TXT file on server

查看:263
本文介绍了将表单结果写入服务器上的TXT文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个从一个或两个文本框接收数据的表单,并将该数据发送到服务器上的文本文件。 />
我正在使用Windows 10 Pro附带的Web服务器。

I’m trying to create a form that receives data from one or two text boxes and send that data to a text file on the server.
I’m using the Web Server that comes with Windows 10 Pro.

如何将表单结果写入服务器中的文本文件?

How do I get the form results to be written to a text file in the server?

提前致谢

推荐答案

CNT,

您使用哪种技术来实现此目的?根据你的描述,也许它是一个Web应用程序?

Which technology do you use to achieve this purpose? According to your description, maybe it is a web application?

这个论坛正在讨论和讨论Windows Forms,所以如果你使用Winform并想写一个文本文件,你可以参考到以下代码:

This forum is discussing and talking about Windows Forms, so if you use Winform and want to write to a text file, you can refer to the following code:

        private void button1_Click(object sender, EventArgs e)
        {
            string[] lines = { textBox1.Text,textBox2.Text };
            System.IO.File.WriteAllLines(@"D:\Test\WriteLines.txt", lines);
        }

最好的问候,

Stanly


这篇关于将表单结果写入服务器上的TXT文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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