Programs store their data in main memory. On program exit, all this data is lost. Therefore, when you restart your program, all the fields (like your auto-increment number) will no longer hold their former values.
To fix this, you need to write the auto-increment number to disk, e.g. by storing it in a file. Then, on program start, you want to load the previously saved number back into main memory.
发布评论
评论(1)
程序将其数据存储在主存储器中。程序退出时,所有这些数据都会丢失。因此,当您重新启动程序时,所有字段(例如自动递增数字)将不再保留其以前的值。
要解决此问题,您需要将自动递增数字写入磁盘,例如将其存储在文件中。然后,在程序启动时,您希望将先前保存的数字加载回主存储器。
Programs store their data in main memory. On program exit, all this data is lost. Therefore, when you restart your program, all the fields (like your auto-increment number) will no longer hold their former values.
To fix this, you need to write the auto-increment number to disk, e.g. by storing it in a file. Then, on program start, you want to load the previously saved number back into main memory.