save

How do you load information from a .txt file in batch?

寵の児 提交于 2019-12-08 08:12:05
问题 So I have been doing some small batch programs lately but I can't manage to make the batch file load information. This is how i would do it. :load_game ) set /p something= ) > something.txt In the txt file: something_is_awesome That is it^^ If i remember it right that is how you SAVE a file... now how do you LOAD it in a similar way? Note: I would like to do multiple at once! 回答1: to WRITE a line to a file use echo my_information>something.txt (overwriting) to READ a line from a file use set

How to write an observable collection to a txt file?

一曲冷凌霜 提交于 2019-12-08 07:51:24
Whats the best way to write an observable collection to a txt file? I currently have the following public ObservableCollection<Account> SavedActionList = new ObservableCollection<Account>(); using (System.IO.StreamWriter file = new System.IO.StreamWriter("SavedAccounts.txt")) { foreach (Account item in SavedActionList) { file.WriteLine(item.ToString()); //doesn't work } file.Close(); } I'm not sure why it won't write to the file. Any ideas? You can easily just write: File.WriteAllLines("SavedAccounts.txt", SavedActionList.Select(item => item.ToString())); However, this will require your

Saving data from textboxes into text file

北战南征 提交于 2019-12-08 07:39:50
问题 I am trying to write a program to me should be a lot easier than it is proving. I have a form with text boxes that asks the user to enter their details e.g. Name, Address etc.. What I am trying to achieve is to save the data from the text boxes into a .txt file when the user hits the save button. I am able to create the file but the data will not save into the file. I have posted my code below, and any help you may have will be greatly appreciated. private void btnSave_Click(object sender,

Save “backup copy” of workbook without committing changes to Excel?

大憨熊 提交于 2019-12-08 07:26:45
问题 I'm not sure this is possible but maybe I'm missing something obvious. I want to programmatically, and invisibly save a "backup" copy of the workbook in it's current state, without "committing" the changes to Excel or destroying the Undo history. Example Scenario: User opens c:\folder1\workbookA.xlsm User makes changes to the workbook that they may not wish to commit to . My sub begins due to timer or other event, and in the background, saves a copy of the workbook as c:\folder2\workbookB

php query output save as text file

北城余情 提交于 2019-12-08 07:16:29
问题 I have a page on my website that pulls out information from a table and is formatted with css. I can't find a way to save the page as is, as a text or pdf file. I found a pdf site that does this http://pdfmyurl.com/ but I was hoping to do the same thing on my own site wihtout external sites. The web page has a session making sure the user is logged in, and depending on the user_id depends what data is pulled out the database. To clarify, I want the users to be able to view this page. On the

Get access to ForeignKey objects at parent save in Django

寵の児 提交于 2019-12-08 06:35:35
问题 I am trying to make a combined image of all images added to a modell in django with inline editing and a ForeignKey. Ive got these models (simplified): class Modell(models.Model): title = models.CharField('beskrivelse', max_length=200) slug = models.SlugField() is_public = models.BooleanField('publisert', default=True) def __unicode__(self): return self.title def save(self, **kwargs): super(Modell, self).save(**kwargs) on_modell_saved(self) class Image(models.Model): modell = models

jqgrid inline edit - Save handler when clicking enter

非 Y 不嫁゛ 提交于 2019-12-08 06:32:03
问题 Im wondering if there is an event handler for the save method when clicking enter to save the row. I want to use it to hide the row from the grid after being saved. thanks in advance! 回答1: Both editRow and saveRow inline editing methods has succesfunc and aftersavefunc parameters which you can use. The aftersavefunc has small advantage because it is used in both local and remote holding of the grid data. So the code can be ondblClickRow: function (rowid) { $(this).jqGrid('editRow', rowid,

InkCanvas to BitMap

给你一囗甜甜゛ 提交于 2019-12-08 06:24:32
问题 I have a problem with saving canvas to BMP file (or any other type). I'm trying to save my InkCanvas like this: int margin = (int)canvas.Margin.Left; int width = (int)canvas.ActualWidth -margin; int height = (int)canvas.ActualHeight -margin; //render ink to bitmap RenderTargetBitmap renderBitmap = new RenderTargetBitmap(width, height, 96d, 96d, PixelFormats.Default); renderBitmap.Render(canvas); //save the ink to a memory stream BitmapEncoder encoder; encoder = new BmpBitmapEncoder(); encoder

Java - Program which remembers/saves entered fields

六眼飞鱼酱① 提交于 2019-12-08 04:18:34
问题 I have a program that uses three JTextField fields as the main data entry fields. I want to have it so that when the user terminates the program and then opens it again, their last entry will still be in the fields. How could I achieve this? Would I need some sort of database or is there a simpler way? 回答1: the simplest way to achieve this is to add a listener to the text field and use the java preferences api: textField = new JTextField(); // set document listener textField.getDocument()

Get-Content : Cannot find path

隐身守侯 提交于 2019-12-08 04:18:22
问题 I'm trying to write a script in PowerShell which reads in a "foreach" loop all the only files in a specific folder which contains "example" in it's name. The problem is that I'm trying to save the content of each file in a variable without any success. Tried to use Get-Content $file and it throws the following error " Get-Content : Cannot find path " even though the path was set at the beginning to the Folder var and file actually contains the file that I need. I can't assign it to