小编Haj*_*tsu的帖子

允许用户从图片框中复制图像并将其保存在任何地方

在我的应用程序中,我有一个pictureBox显示图像.当用户右键单击pictureBoxCopy从上下文菜单中选择时,我想将图像复制到剪贴板中,以便用户可以将其粘贴到文件夹和其他任何位置.我怎样才能做到这一点?

编辑:我使用此代码但该用户只能将图像粘贴到word中.

var img = Image.FromFile(pnlContent_Picture_PictureBox.ImageLocation);
Clipboard.SetImage(img);
Run Code Online (Sandbox Code Playgroud)

c# clipboard image copy-paste

5
推荐指数
2
解决办法
6428
查看次数

为什么要安装Microsoft Visual C++ 2010 Redistributable Package x86来使用SQLite?

我用C#和SQLite编写了windows应用程序.当PC应用程序上安装Microsoft Visual C++ 2010 Redistributable Package x86正确运行但如果未安装Microsoft Visual C++ 2010 Redistributable Package x86,则应用程序不会运行.为什么?
SQLite依赖于Microsoft Visual C++ 2010 Redistributable Package x86吗?

c# sqlite visual-c++

2
推荐指数
1
解决办法
8308
查看次数

使用正则表达式在C#中搜索阿拉伯语文本

我想用正则表达式和C#在阿拉伯语文本中创建搜索模块.谁能帮我?我什么都不知道.在我的搜索模块中,当用户惰性"من"没有Alphabet()时,模块返回منمنمن和其他.如何创建这个模块?谢谢.

regex search arabic c#-4.0

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

为ListView设置TypeFace

我有2个XML文件列表视图.一个用于视图,另一个用于第一个.note_list.XML是:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="10dip" >

    <Button
        android:id="@+id/allNotes_btn_refresh_list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/all_note_refresh_list" />

    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="match_parent" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

和list_otem.XML是:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/list_lbl_id"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone" />

    <TextView
        android:id="@+id/list_lbl_subject"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <TextView
        android:id="@+id/list_lbl_date"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

在下面的代码中,我为列表设置了适配器:

ArrayList<HashMap<String, String>> noteList;
ListView lv;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.note_list);
    noteList = new ArrayList<HashMap<String, String>>();
    lv = getListView();

    lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> …
Run Code Online (Sandbox Code Playgroud)

android android-listview

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

Alamofire,未声明类型的使用

我正在使用 Alamofire 进行 SSL 固定。为此,我使用以下代码:

import Foundation
import Alamofire
import SwiftyJSON   

class CertificateManager {
    init() {
        let serverTrustPolicies: [String: ServerTrustPolicy] = [
            "test.example.com": .pinCertificates(
                certificates: ServerTrustPolicy.certificates(),
                validateCertificateChain: true,
                validateHost: true
            ),
            "insecure.expired-apis.com": .disableEvaluation
        ]

        let sessionManager = SessionManager(
            serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
        )
    }
}
Run Code Online (Sandbox Code Playgroud)

但发生了这些错误:

使用未声明的类型错误

我的 pod 文件是:pod 'Alamofire', '~> 5.0.0-rc.2'.

我搜索并测试了一些解决方案,但无法解决错误。我怎样才能解决这个问题?

我也试过这个答案。+

ssl xcode swift alamofire

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

将文件和图像上传到android中的php服务器

我在java中使用以下代码通过网络在php服务器上传图像.

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import android.util.Log;

public class UploadFiles {

    public void upload(String selectedPath) throws IOException {
        HttpURLConnection conn = null;
        DataOutputStream dos = null;
        DataInputStream inStream = null;
        String lineEnd = "\r\n";
        String twoHyphens = "--";
        String boundary = "AaB03x87yxdkjnxvi7";
        int bytesRead, bytesAvailable, bufferSize;
        byte[] buffer;
        int maxBufferSize = 1 * 1024 * 1024;
        String urlString = "http://android.1mohammadi.ir/nightly/upload_files.php";
        try {
            // ------------------ CLIENT REQUEST
            FileInputStream fileInputStream …
Run Code Online (Sandbox Code Playgroud)

php android file-upload

0
推荐指数
1
解决办法
6889
查看次数

Android 模拟器上的 Expo 无法运行,出现问题

我想在 Android 模拟器上运行 React Native 应用程序。当我运行时expo start,Metro Builder 在 chrome ( http://localhost:19002/)上打开,然后我单击Run on Android device/emulator. 应用程序安装在模拟器上,但 Expo 应用程序收到此错误: 世博港 我认为这是针对港口的。我该如何解决这个错误?我升级了 React Native 并从 StackOverflow 解决了许多问题。但问题没有解决。

地铁建设者

port android android-virtual-device react-native expo

0
推荐指数
1
解决办法
4041
查看次数