TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
unsal osma
NA
44
1.5k
upload all the files in the folder one by one
Nov 14 2018 1:21 PM
Hello
Google drive with c#
upload all the files in the folder one by one
my code this;
private void button1_Click(object sender, EventArgs e)
{
textBox10.Clear();
try
{
UserCredential credential;
credential = GetCredentials();
var service = new DriveService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName ="TDBACKUP",
});
string folderid;
var fileMetadatas = new Google.Apis.Drive.v3.Data.File()
{
Name = txtFolderNameUpload.Text,
MimeType = "application/vnd.google-apps.folder"
};
var requests = service.Files.Create(fileMetadatas);
requests.Fields = "id";
folderid = "";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
label7.Text = "Son Yüklenen Dosya Adi : " + txtFolderNameUpload.Text + "\r\n\r\n";
foreach (string filename in openFileDialog1.FileNames)
{
Thread thread = new Thread(() =>
{
UploadFolder(filename, service, folderid);
label7.Text += "Yedekleme Basarili." + "\r\n";
});
thread.IsBackground = true;
thread.Start();
}
MessageBox.Show("islem tamam");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + " " + ex.InnerException);
}
}
Reply
Answers (
2
)
SingalR in Asp.Net.webapi
String or binary data would be truncated.