首页 \ 问答 \ 保存并加载数组的初始状态(int [,])(Save and load initial state of an array (int[,]))

保存并加载数组的初始状态(int [,])(Save and load initial state of an array (int[,]))

我正在尝试保存数组的状态,以便稍后在其初始状态下加载它。 但我不知道如何使它们成为单独的实例,而不是相互引用。 以下是一些示例代码:

static void Main(string[] args)
{
    int[,] first = new int[5, 5];
    int[,] second = first;

    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
        {
            first[i, j] = i * j;
        }
    }

    first[0, 0] = 10000;
    first = second;
    Console.WriteLine(first[0, 0]); //10000
}

I'm trying to save the state of an array so I can load it later in it's initial state. But I don't know how to make them separate instances, and not to reference each other. Here's some sample code:

static void Main(string[] args)
{
    int[,] first = new int[5, 5];
    int[,] second = first;

    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
        {
            first[i, j] = i * j;
        }
    }

    first[0, 0] = 10000;
    first = second;
    Console.WriteLine(first[0, 0]); //10000
}

原文:https://stackoverflow.com/questions/24780126
更新时间:2023-04-25 09:04

最满意答案

您可以在Adobe网站上找到适用于MACPC的 flash 8的as2 Remoting组件。 它可能不安装在Flash CS3的正确文件夹中,但有mx.remoting类与您的其他as2 mx软件包位于相同的文件夹中,NetConnection调试器位于WindowSWF文件夹中,而swc本身位于Common Library 。

我现在在办公室而不是在家里上课,所以我不是100%准确的。

我记得在amfphp网站上有关于as2的一些方便的视频教程。


You can find the as2 Remoting Components for flash 8 for the MAC and PC on the Adobe website. It might not install in the right folder for Flash CS3, but there are the mx.remoting classes that go in the same folder with your other as2 mx packages the NetConnection Debugger that goes in the WindowSWF folder and the swc themselves that go in Common Libraries.

I have the classes at the office, not home, where I am now, so I'm not 100% accurate.

I remember there were some handy video tutorials on as2 on the amfphp website.

相关问答

更多
  • “硅谷动力”这个网站有,你在百度网页搜索引擎就能打开这个网页了,祝你好运!希望采纳!
  • 你也可以看看下面的教程 教程1:金鹰FLASH.CS3活学活用【压缩后532MB】 教程2:Flash CS3 ActionScript 3.0组件高级编程(压缩后 532MB) 教程3:Flash CS3 ActionScript 3.0类编程入门到精通(压缩后780MB) 教程4:Flash CS3 AS3声音视频高级编程(官方价:380元)【压缩后668MB】 教程5:Flash ActionScrip 3.0实用教程(官方价:280元)【压缩后380MB】 教程6:Flex3.0快速入门(官方价:1 ...
  • 在代码方面,CS3和CS4之间没有区别。 您只需要在发布设置中定位当前的Flash Player 10平台。 它们都使用相同的Actionscript 3库。 您无法在CS3中加载CS4项目,但可以将项目保存为与闪存CS4内部的CS3兼容。 哦,我的坏。 CS3无法为Flash 10平台编译。 因此,没有。 没有库,因为所有更改都需要Flash Player 10的新优势。 但是,您可以使用flex来编译代码。 但是,这将要求您将代码转换为flex。 There is no difference betwe ...
  • 您是通过装载器将它们加载到SWF中的吗? 或者它们是作为位图符号导入到库中的? 如果它们在尝试调用Bitmap.smoothing = true; 或者如果它们位于库中,请转到位图的属性并单击允许平滑。 除此之外,我会检查以确保您没有超过1 alpha设置的某些疯狂,或者您在任何时候都不会在代码中搞乱它的规模。 这两个选项往往会混淆位图图像的模糊性。 如果一切都失败了,你可能会希望考虑将你的图像转换为基于矢量的图形,那么他们总是会看到你想要他们如何不管缩放比例。 Are you loading them i ...
  • var foo:LoadVars = new LoadVars(); foo.onData = function(value:String) { if (value != undefined) { trace(value); } }; foo.name = "John"; foo.age = 19; foo.sendAndLoad("content.txt", foo, "GET"); var foo:LoadVars = new LoadVars(); foo.on ...
  • 在as3中,JSON用于编码/解码从php到flash的数据,反之亦然。 您将需要as3corelib才能使用此功能。 I was able to figure it out. It turns out AMF is a format - http://en.wikipedia.org/wiki/Action_Message_Format using these hex values Undefined - 0x00 Null - 0x01 Boolean False - 0x02 Boolean True ...
  • 您可以在Adobe网站上找到适用于MAC和PC的 flash 8的as2 Remoting组件。 它可能不安装在Flash CS3的正确文件夹中,但有mx.remoting类与您的其他as2 mx软件包位于相同的文件夹中,NetConnection调试器位于WindowSWF文件夹中,而swc本身位于Common Library 。 我现在在办公室而不是在家里上课,所以我不是100%准确的。 我记得在amfphp网站上有关于as2的一些方便的视频教程。 You can find the as2 Remoti ...
  • 你必须把你的类放在如下目录中: /your root of source files/com/MyComponen/subcomponent1.as 和 /your root of source files/com/MyComponen/subcomponent2.as 进入你们这两个classes申报他们所属的package : 例如,针对子组件1 package com.MyComponen { public class subcomponent1 { //... } } 作为命名约定 : ...
  • 由于没有人知道这个谜,所以我们可以假设在Flash-CS5中,第1帧的导出是可选的,即使它未被选中,在文档类中创建时,在第1帧导出对象或影片剪辑。 请善意评论。 我使用SwiX工具检查过它。 即使它们未在第1帧导出,但使用new运算符在Document Class中创建,也会加载Movie-Clips。 As no-one knows about this mystery so we can assume that in Flash-CS5 export for frame 1 is optional me ...
  • 不幸的是,Adobe完全删除了Flash CC中的AS2支持。 它将使用AS2打开.fla但删除代码。 但是,您仍可以从Creative Cloud应用程序门户/站点下载Flash CS6作为旧版解决方法。 Unfortunately, Adobe totally removed AS2 support in Flash CC. It will open a .fla with AS2 but remove the code. You can, however, still download Flash C ...

相关文章

更多

最新问答

更多
  • 获取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的基本操作命令。。。