.net core - how to access path in c# with username and password -


this question has answer here:

i want access path following code however, throws , error

ioexception: user name or password incorrect system.io.filestream.openhandle(filemode mode, fileshare share, fileoptions  options) 

i use following code

var filepath = "\\\\172.x.x.x\\uploadfolder"; using (var stream = new filestream(filepath, filemode.create) {     await files.first().copytoasync(stream); } 

how can setup user name , password in case?

edit:

as comment below have searched , try again method:

bool returnvalue = logonuser("testdomain\\testaccount", "172.x.x.x", "testpassword",             logon32_logon_interactive, logon32_provider_default,             out safetokenhandle); // i've tried both testdomain\\testaccount , testdomain/testaccount 

it's return false. when test computer it's return true though.

bool returnvalue = logonuser("admin", "127.0.0.1", "password",             logon32_logon_interactive, logon32_provider_default,             out safetokenhandle); 

is problem happens because of domain server or something?

this problem occurs because dont have privilage access or make changes directory. change directory other drives( if possible). or run program administrator privilage. may help


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -