access-denied

Ping server from Azure Function

大城市里の小女人 提交于 2021-02-08 09:14:42
问题 I have the following Azure Function that fails with Access is Denied (ignore the fact that the logic is all weird, I'm just doing a first test) public static void Run(TimerInfo myTimer, ILogger log) { List<string> servers = new List<string>() { "server1" }; foreach(string server in servers) { if (!Ping(server)) { SendEmail($"Server {server} seems down.", log); } } } static bool Ping(string hostName) { Ping pingSender = new Ping(); int timeout = 120; PingReply reply = pingSender.Send(hostName,

How to retrieve file from database?

只愿长相守 提交于 2021-01-29 04:07:57
问题 I have saved a file in a database by converting it in bytes. It is saved successfully but I am unable to retrieve it. Here is code which I used to convert and save: public static void databaseFilePut(string varFilePath) { byte[] file; using (var stream = new FileStream(varFilePath, FileMode.Open, FileAccess.Read)) { using (var reader = new BinaryReader(stream)) { file = reader.ReadBytes((int)stream.Length); } } using (SqlConnection varConnection = new SqlConnection("Data Source=FARHANB

Export-Csv - Access to the path 'C:\export.csv' is denied

和自甴很熟 提交于 2020-05-29 10:16:15
问题 I'm getting the information I need out of the line, although when I go to export the information, I get an error. When I run this code: get-process | Export-csv -Path "C:\export.csv" -NoTypeInformation I get this error: Export-csv : Access to the path 'C:\export.csv' is denied. At line:1 char:14 + get-process | Export-csv -Path "C:\export.csv" -NoTypeInformation + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ How can I export to CSV? 回答1: You need to use an admin console or change the

Xamarin Forms how to Save a file to a location where it can be copied off of the original device

戏子无情 提交于 2020-03-04 18:05:14
问题 My Xamarin forms app required the user to perform a certain amount of configuration before it can be used. Additionally, the app can be run on multiple computers by the same user (There are valid business reasons for doing this.) What I would like to be able to do is backup the configuration of the app to a file that can then be used on another device to automatically configure the app on the new device in exactly the same way. This will prevent the users from re-entering all the

Xamarin Forms how to Save a file to a location where it can be copied off of the original device

你离开我真会死。 提交于 2020-03-04 18:04:16
问题 My Xamarin forms app required the user to perform a certain amount of configuration before it can be used. Additionally, the app can be run on multiple computers by the same user (There are valid business reasons for doing this.) What I would like to be able to do is backup the configuration of the app to a file that can then be used on another device to automatically configure the app on the new device in exactly the same way. This will prevent the users from re-entering all the

access denied using mkdir and rmdir in jenkins

喜欢而已 提交于 2020-02-07 02:36:14
问题 Jenkins is generating a build of a C++ project made in Visual Studio. During the process, some .bat s are called and in one of them, there is a structure like this: SET TEMPDIR=Temp rmdir %TEMPDIR% /S /Q echo Don't continue if there was an error above (except the not found error which is ok) and go hand delete the dir! :pause mkdir %TEMPDIR% I'm not very familiar to batch scripting, but when both rmdir and mkdir are called, Jenkins gives me access denied . I looked in the build configurations

XAML MSBuild task XamlMarkupCompilePass1 fails in parallel MSBuild and throws error Access denied

被刻印的时光 ゝ 提交于 2020-01-31 12:09:57
问题 We have several projects containing XAML UI and XAML workflow files. Since we enabled execution of MSBuild in parallel, with the flag /m the builds, from time to time we get an exception in the MSBuild task XamlMarkupCompilePass1 ##[error]C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets(193,5): Error XC1000: XC1020: Build error occurred in the XAML MSBuild task: 'Could not load file or assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\

System.UnauthorizedAccessException was unhandled

a 夏天 提交于 2020-01-30 06:33:06
问题 I am getting a access denied exception. How can I fix this? Here is the exception: System.UnauthorizedAccessException was unhandled HResult=-2147024891 Message=Access to the path 'c:\message.txt' is denied. Source=mscorlib Here is the code: public static void WriteToFile(string s) { fs = new FileStream("c:\\message.txt", FileMode.Append, FileAccess.Write); sw = new StreamWriter(fs); sw.WriteLine(s); sw.Flush(); sw.Close(); fs.Close(); } EDIT: It works if I run vs2012 as administrator, but is

Can OpenProcess with error code ERROR_ACCESS_DENIED be used to know if process exists?

五迷三道 提交于 2020-01-25 17:46:07
问题 I run the following code on a Windows platform. The purpose is the know if a specific process ID refers to an existing process. BOOL bProcessExists = FALSE; HANDLE hProcHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwProcID); if(hProcHandle) { bProcessExists = TRUE; ::CloseHandle(hProcHandle); } else { if(::GetLastError() == ERROR_ACCESS_DENIED) { bProcessExists = TRUE; } } The process that runs the code above does not run elevated and I found out that OpenProcess can return access

Setting ASP.Net Permissions - Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

走远了吗. 提交于 2020-01-24 18:20:38
问题 I have an MVC 4 application that allows a user to change their Active Directory password through a password reset functionality page. I have the following piece of code that sets the new password: DirectoryEntry de = sr.GetDirectoryEntry(); de.Invoke("SetPassword", new object[] { newPassword }); de.Properties["LockOutTime"].Value = 0; Upon trying to submit the form with the new password details I am having the following error written to the application event log: 0x80070005 (E_ACCESSDENIED))