小编amc*_*ish的帖子

.htaccess密码保护允许127.0.0.1但不允许localhost

我正在尝试密码保护我的公用文件夹,以便任何尝试外部访问的人都会提示输入密码,但不能在本地输入密码.到目前为止,我已经使用127.0.0.1但不是localhost.显然我可能只是使用了ip地址,但事实上我想知道为什么它不起作用.我不喜欢被打败!

#Enable Password Protection
AuthName "Password Protected Server"
AuthType Basic
AuthUserFile c:\xampp\apache\security\.htpasswd
Require valid-user
Order allow,deny
Allow from localhost
Allow from 127.0.0.1
Satisfy Any
Run Code Online (Sandbox Code Playgroud)

到目前为止,我的代码是:

http://www.groovypost.com/howto/how-to/htaccess-password-protect-apache-website-security/

htaccess密码保护但不在localhost上

我在Windows 7上运行XAMPP 1.7.3,以防万一.

任何帮助将不胜感激!

apache security xampp .htaccess

19
推荐指数
1
解决办法
8518
查看次数

Android可检查上下文菜单不记得已选中

我有一个按钮,打开一个上下文菜单,其中包含各种选项列表.一次只能选择一个选项,所以我希望每个选项旁边都有一个单选按钮,突出显示当前选择的项目.当我从上下文菜单中选择一个项目时,单选按钮被选中并关闭.单击按钮打开上下文菜单后,未选择先前选择的项目.

如何让上下文菜单记住之前选择的项目?

其次,首次创建活动时,会选择默认选项.如何设置初始默认值,然后在选择另一个上下文菜单项时可以覆盖该默认值?我可以android:checked="true"在XML中设置,但是当选择不同的项目时可以覆盖它吗?

Java的:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.browse);
    Button buttonView = (Button) this.findViewById(R.id.button_view);
    buttonView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            registerForContextMenu(v);
            openContextMenu(v);
        }
    });
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle(R.string.menu_title);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.context_menu, menu);
}

@Override
public boolean onContextItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case(R.id.item1):
            if(item.isChecked()) {
                item.setChecked(false);
            } else {
                item.setChecked(true);
            }
            break;
        case(R.id.item2):
            if(item.isChecked()) {
                item.setChecked(false);
            } else {
                item.setChecked(true); …
Run Code Online (Sandbox Code Playgroud)

android contextmenu

4
推荐指数
1
解决办法
6942
查看次数

标签 统计

.htaccess ×1

android ×1

apache ×1

contextmenu ×1

security ×1

xampp ×1