首页 \ 问答 \ 在C#中在服务器和客户端之间传递自定义复杂对象(Passing custom complex objects between server and client in C#)

在C#中在服务器和客户端之间传递自定义复杂对象(Passing custom complex objects between server and client in C#)

我有一个桌面C#应用程序,我想分成两部分 - 服务器部分和客户端部分。 我的应用程序已经分成两个非常独立的部分,通过交换一些(复杂的!)对象进行通信。

如果我想将我的应用程序的一部分放在某个Web服务器上,我应该使用什么样的技术在服务器部分和客户端部分之间传递这些自定义复杂对象? 我在考虑WCF,但是......我不确定WCF可以轻松处理(发送/接收)自定义对象(由许多其他自定义对象组成)。 我不需要WCF,因为我不打算向任何第三方提供我的服务,我不打算将我的客户端应用程序移植到其他操作系统......

这就是为什么我很困惑并需要你的帮助:我应该在我的情况下使用什么样的远程技术?


I have a desktop C# app that I want to split into two parts - server part and client part. My app is already split into two very independent parts that communicate by exchanging some (complex!) objects.

If I want to put one part of my app on some web server, what kind of technology should I use for passing those custom complex objects between the server part and client part? I was thinking about WCF, but...I'm not sure that WCF can easily handle (send/receive) custom objects (composed by many other custom objects). I don't need WCF because I'm not planning to offer my service to any third-party, I'm not planning to port my client app to other OS...

That's why I'm confused and need your help: what kind of remoting technology should I use in my case?


原文:https://stackoverflow.com/questions/6714682
更新时间:2023-09-11 13:09

最满意答案

由于您已将$ frontend数组配置为缓存数据10秒,因此缓存的数据将在10秒后自动删除。

我建议你可以增加你的时间

one hour : 3600 or 2 hours like 7200

但是,如果稍后在应用程序中想要手动清理整个缓存数据,只需编写即可

$的cache>干净();

这将清除整个缓存的数据。 但是,如果要删除正在缓存的特定数据,请写入

$的cache>除去( 'MYDATA');

有关缓存的更多使用,请参阅链接

我与上述链接无关,只是为了您的知识

希望这一定会对你有所帮助。


As you have configured our $frontend array to cache data for 10 seconds, so the data cached will automatically be remove after 10 second.

i would suggest that you can increase your time like

one hour : 3600 or 2 hours like 7200

However if later in your application you want to clean the entire cached data manually, simply write

$cache->clean();

This will clean the entire cached data. However if you want to remove specific data being cached, write

$cache->remove(‘mydata’);

for more use of cache see link

i am not associate with above link it is just for your knowledge

hope this will sure help you.

相关问答

更多
  • 为什么不利用ModelForm呢? 表单数据分两步保存: 到表单实例 到模型实例 所以当你有一个表格时: class YourForm(forms.ModelForm): class Meta: model = CustomModel fields = ['count',] def clean(self): cleaned_data = super(self).clean() count = cleaned_data.get ...
  • 当你第一次通过命令行访问缓存文件时,它有可能作为所有者和特定访问掩码(可能是0600)创建。 但是,当您尝试通过浏览器打开文件时,您会充当完全不同的用户(例如www或apache)。 只是也许apache用户不能访问该文件。 It is possible that when you accessed cache file for the first time via command-line it was created with you as an owner and certain access mas ...
  • 由于您已将$ frontend数组配置为缓存数据10秒,因此缓存的数据将在10秒后自动删除。 我建议你可以增加你的时间 one hour : 3600 or 2 hours like 7200 但是,如果稍后在应用程序中想要手动清理整个缓存数据,只需编写即可 $的cache>干净(); 这将清除整个缓存的数据。 但是,如果要删除正在缓存的特定数据,请写入 $的cache>除去( 'MYDATA'); 有关缓存的更多使用,请参阅链接 我与上述链接无关,只是为了您的知识 希望这一定会对你有所帮助。 As yo ...
  • 对不起我之前没有重播过。 很快,我想提出一种方法来捕捉这个以供你考虑。 为简单起见,我将专注于使用输出前端缓存输出。 在您的application.ini中,您可以按如下方式设置捕获: resources.cachemanager.myviewcache.frontend.name = Output resources.cachemanager.myviewcache.frontend.customFrontendNaming = false resources.cachemanager.myviewcac ...
  • 这个答案可能看起来很愚蠢,我没有理由,但我遇到了同样的问题,我通过更换问题解决了这个问题 self.cleaned_data['newpassword1'] 通过 self.cleaned_data.get('newpassword1') 对于所有clean_data集: class PasswordResetForm(SetPasswordForm): def clean(self): cleaned_data = self.cleaned_data if 'newpassword1' in ...
  • 正如@binnyb所说,操作系统会自动清除缓存。 但是,如果你所谓的缓存不是操作系统的缓存(例如,你试图在应用程序内部存储一些数据),那么我建议,检查onPause()或onResume()方法。 我不会依赖onDestroy服务。 As @binnyb said, OS will automatically clear the cache. However, if what you call as cache is not the cache of OS (eg. You trying to store ...
  • 所有要开始的东西都在Zend文档中 。 你必须稍微挖一点并且感到舒服,这不是“我怎么做这个”类型的区域。 但是,通用缓存检查如下所示: $cache = /*cache object*/ if ( !($my_object = unserialize($cache->load('cache_key'))) ) { $my_object = /*not found so initialize your object*/ $cache->save(serialize($my_object)); // m ...
  • 也许你只是犯了一个复制粘贴错误或拼写错误,但是,在你发布的代码中,你有: $frontend= array('lifetime' => 7200, 'automatic_seralization' => true); 即你将automatic_seralization设置为true,而不是automatic_serialization :注意服务中的i 。 Maybe you just made a copy-paste error or a typo error, bu ...
  • 是的, ModelForm清洁涉及模型清洁。 这就是使用ModelForm的想法:有很多有用的默认值可以通过从模型中自动构建表单对象来确定。 我通过个人经验发现了这种干净的链接,但为了支持它我可以参考来源。 在1.8上, ModelForm调用模型实例full_clean方法。 在1.7,它直接调用clean方法。 Form.full_clean() def full_clean(self): # ..... snip self._clean_fields() self._clean ...
  • 似乎iOS 9和iOS 10在Caches文件夹中存储了一些文件,您的应用程序不允许删除。 您可以使用NSFileManager isDeletableFileAtPath:方法进行检查。 -(void)removeCache { //===============清除缓存============== NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。