invoke

How to invoke a php file that is located outside public_html

浪尽此生 提交于 2019-12-04 12:32:33
Im creating a website and i am very OCD when it comes to security so i heard that if you store all of your .php files outside of your public_html folder and invoke them with another .php file that is inside your public_html folder then your risk of an attack is lower. Is this true, if so how would i do this. I read something about using .htaccess but I'm not sure if that was the correct way to do it. I though i could maybe use include but im not sure how include works with parameters. There isn't a huge amount of extra protection offered by this strategy. Mainly, it ensures that if your server

Can I pass path parameters using lambda invoke to another lambda function?

一曲冷凌霜 提交于 2019-12-04 12:09:48
I'm trying to call and get the response from another lambda function using lambda invoke. The problem is other lambda function needs the id to be sent as path parameters (or as a query string). But I do not see an option in lambda invoke for this. If I pass the id in payload the other function will receive it in the event body and not as path parameters. Is there an existing solution for this? Here is a function inside a lambda function which calls another lambda function which receives the data as query string parameters function getWisIqLink(data) { const payload = { queryStringParameters: {

Dynamically calling a dll and method with arguments

怎甘沉沦 提交于 2019-12-04 06:23:36
Basically I'm trying to call a dll by name, instantiate an object, then call a method by name in that dll. I'm getting an "Exception has been thrown by the target of an invocation." during the Method.Invoke. I'm fairly sure my problem is with the typecasting of the arguments of the method. I was wondering if anyone had any input on this exception. Additionally, any suggestions on how to revise my approach are welcome. public void calldll(string dllName, string typeName, string methodName, string arguments) { string[] argumentArray = arguments.Split(new char[] { '|' }, StringSplitOptions.None);

Manipulating UI elements from within another thread

天大地大妈咪最大 提交于 2019-12-04 04:10:16
问题 I'm trying to have a seperate thread in a WinForms C# application start a background worker which controls a ProgressBar (marquee). The issue is that when i try to set the bar to visible it just does nothing, and i've tried many forms of Invoke but they don't seem to help. The following method progressBarCycle is called from a separate thread. BackgroundWorker backgroundWorker = new BackgroundWorker(); public void progressBarCycle(int duration) { backgroundWorker.DoWork += new

How to get PowerShell to wait for Invoke-Item completion?

≯℡__Kan透↙ 提交于 2019-12-03 22:58:57
How do I get PowerShell to wait until the Invoke-Item call has finished? I'm invoking a non-executable item, so I need to use Invoke-Item to open it. Unfortunately you can't by using the Invoke-Item Commandlet directly. This command let has a void return type and no options that allow for a wait. The best option available is to define your own function which wraps the Process API like so function Invoke-Command() { param ( [string]$program = $(throw "Please specify a program" ), [string]$argumentString = "", [switch]$waitForExit ) $psi = new-object "Diagnostics.ProcessStartInfo" $psi.FileName

COM object methods are not executed on the thread that CoInitialize-d and created the object

浪子不回头ぞ 提交于 2019-12-03 19:44:08
问题 I am developing an UI application that creates a COM object along the way. The problem is, I want to "move" this COM object entirely on a different thread. What I do is this: create the new thread I want to move the object into (with CreateThread API) after entering this thread, I'm calling PeekMessage to setup a message queue for it calling CoInitialize, CoCreateInstance to create the COM object, QueryInterface to get the interface I want finally I call a method on the interface that

The uncatchable exception, pt 2

随声附和 提交于 2019-12-03 16:11:13
问题 Update: I've filed a bug report on Microsoft Connect: https://connect.microsoft.com/VisualStudio/feedback/details/568271/debugger-halting-on-exception-thrown-inside-methodinfo-invoke#details If you can reproduce this problem on your machine, please upvote the bug so it can be fixed! Ok I've done some testing and I've reduced the problem to something very simple: i. Create a method in a new class that throws an exception: public class Class1 { public void CallMe() { string blah = null; blah

javascript setTimeout call error

左心房为你撑大大i 提交于 2019-12-03 13:59:02
I want to invoke the window.setTimeot function with my custom scope so I use the call method, but there is something wrong. function foo() { this.bar = function() { console.log("keep going"); window.setTimeout.call(this,this.bar,100); } this.bar(); } new foo; under Firefox this prints to the console only 1 line and then nothing, and under google chrome it throws a TypeError . What is the problem in my code? Using call does not help here: it calls setTimeout with your this object, but the callback function itself is still called from the global scope. What you really want to do is something

Why exceptions are not propagated by WPF Dispatcher.Invoke?

孤街醉人 提交于 2019-12-03 10:42:34
Here's my hypothetical example. I have a very simple WPF window with a one Button. The Button.Click event has a handler that goes like this. Action doit = () => { Action error = () => { throw new InvalidOperationException("test"); }; try { this.Dispatcher.Invoke(error, DispatcherPriority.Normal); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex); throw; } }; doit.BeginInvoke(null, null); I would expect that the exception would be caught and written down by the Trace.WriteLine call. Instead, no exception is caught and the application breaks. Does anybody knows of an possible

PowerShell Invoke-Sqlcmd switches into sqlps session

时光毁灭记忆、已成空白 提交于 2019-12-03 09:45:56
I am writing a script in PowerShell ISE and I am using Invoke-Sqlcmd. After the command is executed the Powershell session switches into sqlps session (PS SQLSERVER:>) and I can't execute script for the second time. I have to quit PowerShell ISE and start it again. So my question is: how to switch back from sqlps to regular ps or how to prevent Invoke-Sqlcmd from switching session. Invoke-Sqlcmd -ServerInstance $server -Database master -Username $user -Password $password -InputFile $file ` -ErrorAction Stop -OutputSqlErrors $true -Variable $variable This doesn't work: Push-Location Invoke