小编Giu*_*ppe的帖子

如何混淆少数类或单个包?

我不会混淆我的所有项目,而只是关键课程.如何编写proguard文件以排除所有项目并仅混淆单个类或单个包?

android proguard

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

WCF&MSMQ和TransactionScope漫长的过程

我正在尝试开发一个WCF服务,它可以同时处理数百次下载和转换.我已经使用从ASP.NET Web应用程序接收消息的事务队列初始化了MSMQ.

经过长期的Internet研究后,我的问题是如何管理管理MSMQ消息的WCF服务方法中的长进程.

问题是,在小尺寸下载时,过程很快完成,并且范围返回完成到MSMQ服务,但如果下载大小很大并且需要下载3/4分钟,则范围返回仍然完成,但是MSMQ服务将MSG重新发送到WCF服务,我有重复的下载.

我想这是一个超时问题,但我已经尝试更好地配置我的主机app.config没有成功.

      <netMsmqBinding>
    <binding name="OrderServiceMsmqBinding" 
             maxRetryCycles="1"
             receiveRetryCount="1"
             retryCycleDelay="00:05:20"
             deadLetterQueue="System"
             receiveErrorHandling="Move"
             exactlyOnce="true"
             durable="true"
             receiveTimeout="00:10:00"
             sendTimeout="00:20:00"
             timeToLive="1.00:00:00" useMsmqTracing="true">
      <security mode="None"></security>
    </binding>
  </netMsmqBinding>
Run Code Online (Sandbox Code Playgroud)

这是WCF服务的方法:

   <OperationBehavior(TransactionScopeRequired:=True, TransactionAutoComplete:=True)> _
Public Sub FfmpegConversion(ffmpegjob As FfmpegJob) Implements IOrderService.FfmpegConversion
    Using sc As New TransactionScope(TransactionScopeOption.Required)
        Try
          ExecuteLongProcess()
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            sc.Complete()
        End Try
    End Using
End Sub
Run Code Online (Sandbox Code Playgroud)

UPDATE

经过长时间的试验和研究,我开始认为不可能对MSMQ队列触发的方法进行长时间的处理.

我使用管理数据的不同线程来解决它,但现在的问题是我失去了TransactionScope的优势,因为一旦作业传递给新线程,那么MSMQ就会认为已经完成了删除msg.

wcf msmq msmq-wcf

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

如何管理自定义首选项布局

我有一个图像和两个文本的自定义首选项,我需要以编程方式更改图像.

我能够获取自定义首选项视图并使用findViewById在布局中找到ImageView,但如果我尝试更改图像,则无效.

我错了什么?

优惠配额

 <?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="horizontal" >


    <ImageView
        android:id="@+id/imageforfacebook"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:padding="5dip"
        android:src="@drawable/icon" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <TextView
            android:id="@+android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fadingEdge="horizontal"
            android:singleLine="true"
            android:text="titolo"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textSize="18sp" />

        <TextView
            android:id="@+android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@android:id/title"
            android:layout_below="@android:id/title"
            android:maxLines="2"
            android:text="descrizione"
            android:textAppearance="?android:attr/textAppearanceSmall" />
    </LinearLayout>

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

代码改变IMAGEVIEW内容

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {

View v = (View) prefs_facebookimage.getView(null, null);
ImageView img = (ImageView) v.findViewById(R.id.imageforfacebook);
Uri uri = Uri.parse(path);
img.setImageURI(uri);
Run Code Online (Sandbox Code Playgroud)

android android-layout

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

标签 统计

android ×2

android-layout ×1

msmq ×1

msmq-wcf ×1

proguard ×1

wcf ×1