Protected Sub SheetSave_Click(sender As Object, e As EventArgs) Handles SheetSave.Click
Response.Clear()
Response.Buffer = True
Response.AddHeader("content-disposition", "attachment;filename=gvtocsv.csv")
Response.Charset = ""
Response.ContentType = "application/text"
Dim sBuilder As StringBuilder = New System.Text.StringBuilder()
For index As Integer = 1 To DisplaySuppliers.Columns.Count - 1
sBuilder.Append(DisplaySuppliers.Columns(index).HeaderText + ","c)
Next
sBuilder.Append(vbCr & vbLf)
For i As Integer = 1 To DisplaySup.Rows.Count - 1
For k As Integer = 1 To DisplaySup.HeaderRow.Cells.Count - 1
If (DisplaySup.Rows(i).Visible = True) Then
sBuilder.Append(DisplaySup.Rows(i).Cells(k).Text.Replace(",", "").Replace(" ", "") + ",")
End If
Next
sBuilder.Append(vbCr & vbLf)
Next
Response.Output.Write(sBuilder.ToString())
Response.Flush()
Response.[End]()
End Sub
现在我将向您展示如何返回JSON
CMS
Lorem ipsum Lorem ipsum Lorem ipsum
![Conference Centre]
//images.places.com/434432/4234328423rf234/Conference_Centre.jpg
more of the same
编辑JSON(我刚添加了一些空格,以便您可以更好地看到它)
JSON
“body" : "Lorem ipsum Lorem ipsum Lorem ipsum\n\n![Conference Centre](\/\/images.places.com\/434432\/4234328423rf234\/Conference_Centre.jpg)\n\nmore of the same"