小编Boa*_*rdy的帖子

从地址栏中获取页面文件名

我想知道是否可以使用jquery或javascript从地址栏中获取页面名称.我知道这可以使用PHP完成,但不是真的想要,因为它只是一个HTML网站.

即如果地址是www.mywebsite.com/hello.htm如何从地址中获取该hello.htm部分.

感谢您的任何帮助,您可以提供.

html javascript jquery

29
推荐指数
3
解决办法
7万
查看次数

在C#中获取操作系统版本/友好名称

我目前正在开发一个C#项目.我想收集用户统计信息以更好地开发软件.我正在使用Environment.OSC#的功能,但它只显示操作系统名称,如Microsoft Windows NT

我希望能够检索的操作系统实际已知名称,例如是否Windows XP, Windows Vista or Windows 7等等.

这可能吗?

c# windows operating-system caption

24
推荐指数
3
解决办法
4万
查看次数

LinearLayout分隔线未显示

我正在开发一个Android项目,我有一个LinearLayout,它包含2个使用无边框按钮样式的水平按钮.

我试图在每个按钮之间显示分隔线,但它们没有出现,但我看不出任何原因.以下是XML布局:

<LinearLayout android:id="@+id/call_log_select_host_button_group"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_alignParentBottom="true"
        android:divider="#ffffff"
        android:showDividers="middle"
        android:dividerPadding="22dp">
        <Button android:id="@+id/call_log_select_btnCancel"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Cancel"
            style="?android:attr/borderlessButtonStyle" />
        <Button android:id="@+id/call_log_select_btnBlock"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Block"
            style="?android:attr/borderlessButtonStyle" />
    </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

感谢您的任何帮助,您可以提供.

android android-linearlayout

24
推荐指数
2
解决办法
3万
查看次数

在C++中创建自定义异常

我正在学习C++,当我尝试创建自己的异常并将它们放在Linux上时,我遇到了这种情况.

我已经创建了一个小测试项目来测试我的实现,下面是我的异常类头文件.

class TestClass : public std::runtime_error
{
public:
    TestClass(char const* const message) throw();
    virtual char const* what() const throw();
};
Run Code Online (Sandbox Code Playgroud)

异常类的源文件是

using namespace std;

TestClass::TestClass(char const* const message) throw()
    : std::runtime_error(message)
{

}

char const * TestClass::what() const throw()
{
    return exception::what();
}
Run Code Online (Sandbox Code Playgroud)

在我的主应用程序中,我正在调用一个抛出异常并在try/catch中捕获它的函数,如下所示:

void runAFunctionAndthrow();

/*
 * 
 */
int main(int argc, char** argv) {
    try
    {
        cout << "About to call function" << endl;
        runAFunctionAndthrow();
    }
    catch (TestClass ex)
    {
        cout << "Exception Caught: " << ex.what() << …
Run Code Online (Sandbox Code Playgroud)

c++ exception

24
推荐指数
2
解决办法
3万
查看次数

HttpContext在类库中不可用

我正在开发一个项目,我有一个需要使用的C#类库System.web.HttpContext.我之前在另一个项目中做过这个没有问题,但现在它没有工作.我不确定我错过了什么,他们都瞄准.net 3.5并且我添加了引用System.web并添加了指令using System.web.

但是,当我尝试并且什么HttpContext都不做时.我尝试使用完整路径,System.web.HttpContext但唯一出现的是与ASP相关的3个项目.

以下是工作项目智能感知和非工作智能感知的截图

下面是工作截图

工作截图

以下是非工作截图

不工作截图

感谢您的任何帮助,您可以提供

c# httpcontext system.web

23
推荐指数
2
解决办法
3万
查看次数

在使用Android Studio的应用程序购买中无法找到IInAppBillingService

我正在研究android项目,我正在使用In App Purchases.这一切都在Eclipe工作,但我看到Android Studio有另一个更新,修复了很多与库依赖相关的问题,除了一个问题外,似乎确实如此.我无法使用IAP服务,因为它一直声明它无法解析为符号.

我按照有人在这里发布的说明,但遗憾的是没有工作.以下是我看过的链接

如何将aidl文件添加到Android studio(来自应用内结算示例)

https://code.google.com/p/android/issues/detail?id=56755

下面是我的项目结构和错误的屏幕截图

项目结构和错误的屏幕截图

android in-app-billing android-studio

22
推荐指数
3
解决办法
8146
查看次数

C#中WPF应用程序中的DialogResult

我目前正在使用WPF在C#中开发应用程序,我一直只使用WF.通常,如果我想问用户一个问题而不是我自己的对话我使用

DialogResult result = MessageBox.show("My Message Question", "My Title", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
Run Code Online (Sandbox Code Playgroud)

这是我第一次使用WPF表单并且DialogResult似乎不可用.我用什么来获得相同的效果.

谢谢你的帮助.

c# wpf

19
推荐指数
2
解决办法
4万
查看次数

淡出一个窗口

我目前正在开发一个wpf c#应用程序.我已将事件触发器添加到窗体的xaml中,以便在窗口加载时淡入,并在窗口关闭时淡出.

褪色工作完美没有任何问题,但淡出效果不起作用.

我已经设置好了,所以窗口在加载时淡入,有一个持续时间为5秒,然后调用窗体淡出事件.

然而,窗口不淡出它只是直接关闭没有动画.以下是淡入和淡出事件的代码

<Window.Triggers>
        <EventTrigger RoutedEvent="Window.Loaded">
            <BeginStoryboard>
                <Storyboard Name="FormFade">
                    <DoubleAnimation Name="FormFadeAnimation"
                                     Storyboard.TargetProperty="(Window.Opacity)"
                                     From="0.0" To="1.0" Duration="0:0:1"
                                     AutoReverse="False" RepeatBehavior="1x" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Window.Unloaded">
            <BeginStoryboard>
                <Storyboard Name="FormFadeOut" Completed="FormFadeOut_Completed">
                    <DoubleAnimation Name="FormFadeOutAnimation"
                                     Storyboard.TargetName="FormFadeOut"
                                     Storyboard.TargetProperty="(Window.Opacity)"
                                     From="1.0" To="0.0" Duration="0:0:1"
                                     AutoReverse="False" RepeatBehavior="1x" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>
Run Code Online (Sandbox Code Playgroud)

谢谢你尽你所能的帮助.

c# wpf animation xaml window

19
推荐指数
3
解决办法
2万
查看次数

如何获取文件ID,以便我可以在Android上从Google Drive API下载文件?

我正在开发一个Android项目,我正在尝试使用Google Drive API并且我已经完成了大部分工作,但我在如何执行下载时遇到了问题.

我无法在任何地方找到我如何获取文件ID以便我可以执行下载.为了测试我检索到的所有文件在我的硬盘帐户,并将它们添加到列表数组,然后拿到ID列表中的第一个文件.

然后我将文件ID复制到命令下载文件,这成功地工作但我不知道如何获取我想下载的特定文件的文件ID.

下面是我用来下载文件的代码.

private void downloadFile()
{
    Thread thread = new Thread(new Runnable() {

        @Override
        public void run() {
            try 
            {
                com.google.api.services.drive.model.File file = service.files().get("0B-Iak7O9SfIpYk9zTjZvY2xreVU").execute();
                //FileList file = service.files().list().execute();
                //List<com.google.api.services.drive.model.File> fileList = file.getItems();
                //com.google.api.services.drive.model.File fileItem = fileList.get(0);
                //Log.d("FileID" , fileItem.getId());
                //Log.d("Count", "Retreived file list");
                if (file.getDownloadUrl() != null && file.getDownloadUrl().length() > 0)
                {
                    HttpResponse resp = service.getRequestFactory().buildGetRequest(new GenericUrl(file.getDownloadUrl())).execute();
                    InputStream inputStream = resp.getContent();
                    writeToFile(inputStream);
                }
            } 
            catch (IOException e)
            {
                Log.e("WriteToFile", e.toString());
                e.printStackTrace();
            }
        }
    });
    thread.start();
} …
Run Code Online (Sandbox Code Playgroud)

android google-drive-api

19
推荐指数
5
解决办法
7万
查看次数

以编程方式将程序注册到"添加/删除程序"并将文件存储在可执行文件中

我正在开发一个Windows c#console应用程序,我想让用户安装到他们的计算机上.

我想将自己的Windows Installer可执行文件作为Visual Studio中内置的安装部署工具,看起来在某种程度上缺乏自定义和文档的功能.

因此,因为我想创建自己的Windows安装程序,如何将我的程序注册到"添加/删除程序"窗口中,以便他们可以选择在需要时再次卸载它,并重新启动我的安装程序以执行删除操作.

同样,可执行文件显然需要将文件复制到PC上的各个位置,即C:\Program Files如何将可执行文件存储在Windows安装程序可执行文件中,以便将它们移动到正确的位置.

这可能吗?

感谢您的任何帮助,您可以提供.

c# install uninstall

18
推荐指数
1
解决办法
1万
查看次数