在我的应用程序中,我有一个pictureBox显示图像.当用户右键单击pictureBox并Copy从上下文菜单中选择时,我想将图像复制到剪贴板中,以便用户可以将其粘贴到文件夹和其他任何位置.我怎样才能做到这一点?
编辑:我使用此代码但该用户只能将图像粘贴到word中.
var img = Image.FromFile(pnlContent_Picture_PictureBox.ImageLocation);
Clipboard.SetImage(img);
Run Code Online (Sandbox Code Playgroud) 我用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#在阿拉伯语文本中创建搜索模块.谁能帮我?我什么都不知道.在我的搜索模块中,当用户惰性"من"没有Alphabet()时,模块返回منمنمن和其他.如何创建这个模块?谢谢.
我有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) 我正在使用 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'.
我搜索并测试了一些解决方案,但无法解决错误。我怎样才能解决这个问题?
我也试过这个答案。+
我在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) android ×3
c# ×2
alamofire ×1
arabic ×1
c#-4.0 ×1
clipboard ×1
copy-paste ×1
expo ×1
file-upload ×1
image ×1
php ×1
port ×1
react-native ×1
regex ×1
search ×1
sqlite ×1
ssl ×1
swift ×1
visual-c++ ×1
xcode ×1