private void btnTest_Click(object sender, EventArgs e) { OpenAPI client = new OpenAPI(); string token; IList <contentItem> contentList = new List <contentItem>(); token = client.getTokenID(txtUsername.Text, txtPass.Text, txtServer.Text); contentList = client.getContentItems(txtServer.Text, token); txtTest.Text += token; txtTest.Text += "\n"; }
public void getContentsfromCMS() { OpenAPI client = new OpenAPI(); string token, imgPath, username, password, server; int count = 0; IList <contentItem> contentList = new List <contentItem>(); username = Settings.Default.username; password = Settings.Default.password; server = Settings.Default.server; token = client.getTokenID(username, password, server); contentList = client.getContentItems(server, token); foreach (var content in contentList) { imgPath = client.downloadImages(server, content, token, username); this.dataGridView1.Rows.Add(); this.dataGridView1.Rows[count].Height = 109; Image img; img = Image.FromFile(imgPath); this.dataGridView1.Rows[count].Cells[0].Value = img; this.dataGridView1.Rows[count].Cells[1].Value = content.contentName; this.dataGridView1.Rows[count].Cells[2].Value = content.totalSize; this.dataGridView1.Rows[count].Cells[3].Value = content.creatorId; this.dataGridView1.Rows[count].Cells[4].Value = content.createDate; this.dataGridView1.Rows[count].Cells[5].Value = content.contentId; count++; } setRowNumber(this.dataGridView1); }