C#
- 5 ответов
- 0 вопросов
3
Вклад в тег
<DataGrid Name="dataGridView1" IsReadOnly="True" ColumnWidth="*" VerticalAlignment="Top"
CanUserResizeColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
CanUserReorderColumns="False" BorderThickness="0">
<DataGrid.Columns>
<DataGridTextColumn Header="Номер карты" Binding="{Binding Column1}"></DataGridTextColumn>
<DataGridTextColumn Header="Симптомы" Binding="{Binding Column2}"></DataGridTextColumn>
<DataGridTextColumn Header="Диагноз" Binding="{Binding Column3}"></DataGridTextColumn>
<DataGridTextColumn Header="Лечение" Binding="{Binding Column4}"></DataGridTextColumn>
<DataGridTextColumn Header="Дата приема" Binding="{Binding Column5}"></DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
using System.Windows;
namespace WpfApp2
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
dataGridView1.Items.Add(new TestData { Column1 = "Col1,Row1", Column2 = "Col2,Row1", Column3 = "Col3,Row1", Column4 = "Col4,Row1", Column5 = "Col5,Row1" });
dataGridView1.Items.Add(new TestData { Column1 = "Col1,Row2", Column2 = "Col2,Row2", Column3 = "Col3,Row2", Column4 = "Col4,Row2", Column5 = "Col5,Row2" });
dataGridView1.Items.Add(new TestData { Column1 = "Col1,Row3", Column2 = "Col2,Row3", Column3 = "Col3,Row3", Column4 = "Col4,Row3", Column5 = "Col5,Row3" });
}
}
public class TestData
{
public string Column1 { get; set; }
public string Column2 { get; set; }
public string Column3 { get; set; }
public string Column4 { get; set; }
public string Column5 { get; set; }
}
}
using (var client = new HttpClient())
{
gate.addHeaders(client);
client.DefaultRequestHeaders.Pragma.Add(new NameValueHeaderValue("no-cache"));
var content = new StringContent(body, gate.getEncode(), gate.getMediaType()); // тело запроса
var result = await client.PostAsync(uri, content); // запрос
var buffer = await result.Content.ReadAsByteArrayAsync();
var byteArray = buffer.ToArray();
var responseString = Encoding.GetEncoding(1251).GetString(byteArray, 0, byteArray.Length);
}