任何人都知道如何使用PHP创建和保存XML?我需要这样的东西:
<jukebox>
<track source="" artist="" album="" title="" />
<track source="" artist="" album="" title="" />
<track source="" artist="" album="" title="" />
<track source="" artist="" album="" title="" />
</jukebox>
Run Code Online (Sandbox Code Playgroud) 我正在使用 Visual Studio 2015 开发一个 C# 应用程序,它有 2 个表单,在 form1 上我有一个按钮,单击时会显示 form2,现在我想做的是在完全加载后打印 form2,我正在使用 printform 控件form2 要做到这一点,如果我在 form_load 事件上使用它,它会打印一个空白页,然后显示该表单,我也尝试在 form_Shown 上使用它,但是这会打印一个框,其中元素是但不是元素本身,好像他们还没有完成加载,可能有更好的方法来做到这一点,但我是 C# 新手,所以仍在学习
下面是我在 form2 上的代码示例
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MyApp
{
public partial class Form2: Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
this.Shown += new System.EventHandler(this.Form2_Shown);
}
private void Form2_Shown(object sender, EventArgs e)
{
printForm.Print();
}
}
}
Run Code Online (Sandbox Code Playgroud)