|
The original HTMl code from the post on this website for the Notepad (which does work, though replacing the snippingtool.exe does not) is:
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/system32/notepad.exe", 1, false);
}
</script>
</head>
<body>
<input type="button" value="Notepad" onclick="RunFile();"/>
</body>
</html>
|
|
|
|
|
This will only work in IE and only if the user enables unsafe active x. But even doing that, I also could not get SnippingTool to work. If you google WshShell.Run SnippingTool.exe you'll see other examples of people doing it through VBA or VBS so something may help.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks RyanDev for the Google search tip. It did not take long to find the problem and correct the code so it works as .hta at least. The issue was with Windows 10 redirecting 64bit snippingtool to Windows\SysWOW64 folder. The fix was simply changing the path name in the code to Windows\sysnative and the code now works (See below).
<html>
<head>
<title>Application Executer</title>
<HTA:APPLICATION ID="oMyApp"
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:/windows/sysnative/snippingtool.exe", 1, false);
}
</script>
</head>
<body>
<input type="button" value="SnippingTool" onclick="RunFile();"/>
</body>
</html>
|
|
|
|
|
How weird. The original path you had worked if you put it into the Run command of the Start Menu so that's quite strange.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The "run" dialog is a 64-bit application, so it's not subject to the whims of the file system redirector:
In most cases, whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64.
If the access causes the system to display the UAC prompt, redirection does not occur. Instead, the 64-bit version of the requested file is launched.
32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32.
Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one. Yeah, that's not even slightly complicated, Microsoft!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Two type provide adding a table in nopcommerce. One for Nop.Admin and second for Nop.web(Nop.admin used admin side and if we are an add table in user side then used Nop.web)
so I want to add a new table in Nop.web interface (I mean to say we want integration in nopCommerce new tables in the User interface. Like create form "CustomOrder" in user side. )
Please anyone help.
|
|
|
|
|
|
Hello,
I want to switch between UI router tabs with same state and different parameters.
I have created array for tabs with same route and different parameters, but when we switch between tabs only 1st time we are able to fetch parameters, when next tab is clicked we can't fetch parameters and URL is also not changing.
Can anyone help me out of this.
Thanks for your time.
.state("child.tab", {
url: "/tab/{TableId:int}",
cache: false,
reloadOnSearch: true,
params: { TableId: null },
views: {
'filters@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/abc.html');
}]
},
'list@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/xyz.html');
}]
},
'form@child.tab': {
templateProvider: ['$stateParams', '$templateFactory', function ($stateParams, $templateFactory) {
return $templateFactory.fromUrl('templates/user/pqr.html');
}]
}
}
})
|
|
|
|
|
|
|
did you try use reddit for it?
|
|
|
|
|
Yes i have posted links on reddit. Thanks for reply
|
|
|
|
|
Here is my registerController
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* <a href="https://www.codeproject.com/Members/var">@var</a> string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* <a href="https://www.codeproject.com/Members/return">@return</a> void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* <a href="https://www.codeproject.com/Members/param">@param</a> array $data
* <a href="https://www.codeproject.com/Members/return">@return</a> \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'fname' => 'required|string|max:255',
'lname' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
'phone' => 'required|string|max:255',
'address' => 'required|string|max:255',
'user_type' => 'required|string|max:20',
]);
}
/**
* Create a new user instance after a valid registration.
*
* <a href="https://www.codeproject.com/Members/param">@param</a> array $data
* <a href="https://www.codeproject.com/Members/return">@return</a> User
*/
protected function create(array $data)
{
return User::create([
'fname' => $data['fname'],
'lname' => $data['lname'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'phone' => $data['phone'],
'address' => $data['address'],
'user_type' => $data['user_type'],
]);
}
}
|
|
|
|
|
have a scenario where my apigateway is going to be made secure, which is the entry to access all micro services.
Right now we use these APIs for web based apps by making server side calls(using C#).
we are going to make the APIs public, where mobile apps, other web apps or other services can request them to consume the data.
Is there a secure way to perform API request from client side script like javascript?
As far as i have come across, it is quite impossible.
Expecting some good suggestions. Any further discussion is warmly welcomed.
What I have come across:
1.I have read across few articles mentioning use of proxy servers in between client and API server.
2.Hashing combination of informations and passing in headers.
3.Storing information in cookies.
|
|
|
|
|
I have a Rows Per Page selector. It's two labels with a Select element between them. When I applied a style, the elements now show up vertically:
See here
Here's my HTML
<div id="headerLeft" style="position: relative; width:50%; float:left">
<pre>
<label>Show</label>
<div class="select-style">
<select id="rowsperpage" name="rowsperpage" onchange="updateRowsPerPage(this.value)">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
</div>
<label>rows</label>
and my CSS
.select-style {
border: 1px solid #ccc;
width: 65px;
border-radius: 3px;
overflow: hidden;
background: #fafafa url("img/icon-select.png") no-repeat 90% 50%;
}
.select-style select {
padding: 5px 8px;
width: 130%;
border: none;
box-shadow: none;
background: transparent;
background-image: none;
-webkit-appearance: none;
}
.select-style select:focus {
outline: none;
}
How do I get these elements to align horizontally?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Try:
#headerLeft > label,
#headerLeft > select {
display: inline-block;
}
display - CSS | MDN[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK, so now I have
.select-style {
border: 1px solid #ccc;
width: 65px;
border-radius: 3px;
overflow: hidden;
background: #fafafa url("img/icon-select.png") no-repeat 90% 50%;
}
.select-style select {
padding: 5px 8px;
width: 130%;
border: none;
box-shadow: none;
background: transparent;
background-image: none;
-webkit-appearance: none;
}
.select-style select:focus {
outline: none;
}
<h1>headerLeft > label,</h1>
<h1>headerLeft > select {</h1>
display: inline-block;
}
(CP is changing the #headerLeft to H1)
No change. Did I apply this right?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Sorry, I missed the nested <div> . Try:
#headerLeft > label,
#headerLeft > div {
display: inline-block;
}
(You can avoid the <h1> bug by un-ticking the "Use Markdown formatting" box under the message preview.)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That did it.
I get the basic idea of CSS, but I've yet to start really learning it. Trying to get the basics of HTML and JavaScript down now.
Thanks!
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Check out the magnificent flex-box model
.list{display:flex;flex-direction:row;}
.list-item{width:33%;}
<div class="list">
<div class="list-item">1</div>
<div class="list-item">2</div>
<div class="list-item">3</div>
</div>
Flex boxes can do a lot more, it definitely worth to take some time and learn to use them.
|
|
|
|
|
I have a WebGrid on a page, and I added a Combox Box with 10,25, and 50 as items. When the user selects one I want to change the WebGrid's RowsPerPage accordingly. So far I have the following:
Controller CTOR
public HomeController()
{
ViewData["RowPerPage"] = 10;
}
HTML
var grid = new WebGrid(Model, rowsPerPage: Convert.ToInt32(ViewData["RowPerPage"]), canPage: true, ajaxUpdateContainerId: "divData");
Combo Box
<div id="headerLeft" style="position: relative; width:50%; float:left">
<label >Show</label>
<select id="rowsperpage" name="rowsperpage" onchange="updateRowsPerPage(this)">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
<label >rows</label>
</div>
JavaScript
function updateRowsPerPage(selectedObject) {
var selectedRowsPerPage = selectedObject.value;
}
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
You're going to need to post the value back to the server, in the same way that you did with the search value. You'll need to handle the case when both values need to be sent.
Models:
public class DashboardInfoQueryArgs
{
public string SearchValue { get; set; }
public int RowsPerPage { get; set; } = 10;
}
public class DashboardInfoViewModel
{
public DashboardInfoQueryArgs Query { get; set; }
public IEnumerable Data { get; set; }
public IEnumerable<SelectListItem> PageSizeOptions
{
get
{
yield return new SelectListItem { Value = "10", Text = "10", Selected = Query.RowsPerPage == 10 };
yield return new SelectListItem { Value = "25", Text = "25", Selected = Query.RowsPerPage == 25 };
yield return new SelectListItem { Value = "50", Text = "50", Selected = Query.RowsPerPage == 50 };
}
}
}
Controller:
public ActionResult Index()
{
var args = new DashboardInfoQueryArgs();
return Index(args);
}
[HttpPost]
public ActionResult Index(DashboardInfoQueryArgs args)
{
var data = _dal.GetDashboardInfos(args);
var model = new DashboardInfoViewModel { Query = args, Data = data };
return View(model);
}
View:
@model YourNamespace.DashboardInfoViewModel
@using (@Html.BeginForm("Index", "Home"))
{
<div class="clearfix">
<div class="header-label">
<label>Show</label>
@Html.DropDownList("RowsPerPage", Model.PageSizeOptions, new { @class = "rows-per-page" })
<label>rows</label>
</div>
<div class="header-label">
<label>Search</label>
@Html.TextBox("SearchValue", Model.Query.SearchValue, new { @class = "search-value" })
</div>
</div>
<div id="divData">
@{
var grid = new WebGrid(Model.Data, rowsPerPage: Model.Query.RowsPerPage, canPage: true, ajaxUpdateContainerId: "divData");
@grid.GetHtml(
emptyRowCellValue: "No Records Found",
htmlAttributes: new { id = "web-grid" },
mode: WebGridPagerModes.All,
columns: grid.Columns
(
grid.Column("RowId", "Row Id", style: "rowid-column-style", format: @@item.RowId),
grid.Column("SiteId", "Site Id", style: "siteid-column-style", format: @@item.SiteId),
))
}
</div>
}
@section Scripts {
<script>
$(function(){
var reloadGrid = function(){
var data = {
SearchValue: $(".search-value").val(),
RowsPerPage: $(".rows-per-page").val()
};
$("#divData").load("/Home/Index #web-grid", data);
};
$(".rows-per-page").on("change", reloadGrid);
$(".search-value").on("change keydown paste input", reloadGrid);
});
</script>
}
CSS:
.header-label {
width: 50%;
float: left;
}
.header-label > label,
.header-label > select,
.header-label > input {
display: inline-block;
}
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.clearfix {
*zoom: 1;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK, so I think I see what you have here, and the scary part is I'm starting to understand it
So, I get an error. I get "cannot convert from 'System.Collections.IEnumerable' to 'System.Collections.Generic.IEnumerable<dynamic>'" on this line
var grid = new WebGrid(Model.Data, rowsPerPage: Model.Query.PageSizeOptions, canPage: true, ajaxUpdateContainerId: "divData");
This one I'm confused on.
UPDATE
Figured it out. In the VM I needed
public IEnumerable<dynamic> Data { get; set; }
not
public IEnumerable Data { get; set; }
Thanks!
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 10-May-17 12:54pm.
|
|
|
|
|
Kevin Marois wrote: the scary part is I'm starting to understand it
Some days, even I can understand what I've written.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a WebGrid and search field on a page. When the user types anything into the search field, I want to filter the data and reload the grid.
Here's what I have so far:
Controller
public class HomeController : Controller
{
private IDataAccess _dal;
public HomeController()
{
_dal = new DataAccess();
}
public ActionResult Index()
{
var args = new DashboardInfoQueryArgs();
var data = GetData(args);
return View(data);
}
public IEnumerable GetData(DashboardInfoQueryArgs args)
{
var data = _dal.GetDashboardInfos(args);
return data;
}
[HttpPost]
public IEnumerable Search(string searchValue)
{
var data = GetData(new DashboardInfoQueryArgs(searchValue));
return data;
}
}
HTML
@using (@Html.BeginForm("Index", "Home"))
{
@{
var grid = new WebGrid(Model, rowsPerPage: 10, canPage: true, ajaxUpdateContainerId: "divData");
@grid.GetHtml(
emptyRowCellValue: "No Records Found",
htmlAttributes: new { id = "web-grid" },
mode: WebGridPagerModes.All,
columns:
grid.Columns
(
grid.Column("RowId", "Row Id", style: "rowid-column-style", format: @@item.RowId),
grid.Column("SiteId", "Site Id", style: "siteid-column-style", format: @@item.SiteId),
))
}
}
JavaScript
$("#searchField").on('change keydown paste input', function () {
var searchVal = document.getElementById("searchField").value;
$.ajax({
type: "POST",
url: '/Home/Search',
data: { searchValue: searchVal },
success: function (result) {
},
error: function (result) {
alert('Error!');
}
});
});
Everytging seems to be working, except I don't know to reload the WebGrid once the Search method on the controller is done.
Am I going about this right? What am I missing?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|