由于公司业务需要,需要在生成的word里插入图片(公司印章),仔细想了下,还是在word模板里添加一个书签,然后再该书签的位置插入图片,并设置图片的格式方便些: 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; using System.Data; using Word=Microsoft.Office.I
golang的fmt包实现了格式化I/O函数: package main import "fmt" type Human struct { Name string } func main() { //普通占位符 var people = Human{Name: "咸鱼兆"} // %+v 添加字段名,输出相应值的默认格式 fmt.Printf("%+v\n", people) //相应值用go语法形式输出 fmt.Printf("%#v