VS 2008 File Open Modes?
Mar 8, 2010Can someone point me in the right direction? I am trying to find out the 5 modes a file can be opened in.
I can only think of Input, Read and Shared. What are the other two?
Can someone point me in the right direction? I am trying to find out the 5 modes a file can be opened in.
I can only think of Input, Read and Shared. What are the other two?
I've stress tested the code below and it seems to work fine - what are the dangers of not locking in the simple case where there is a single thread writing and a separate thread reading a simple variable? Have a class that has a public property...
[Code]...
I hhave two modes in my application. Either of the mode is on at any part of time during the running of the application. I have given the user the option to create PicutreBoxes at runtime. Further, I have give two different options to the user.
If the first mode is selected, the Click event for the PictureBox is is pb_clikc and if the second mode is selected, the click event is pb_click_sp.
But the problem is that on the mode select event, I can't specify this line of code since picb is not existing in the current context.
picb.Click += picb_click for Mode1
or
picb.Click += picb_click for Mode2
Is there any way to set coop levels in the .Drawing namespace (or any other namespace, for that matter)?I have made some games in Direct X that were easily shown as full screen apps, but I have returned to the basics of the Graphics class and can find no way to do this. I want to make a full-screen game only using GDI+.Resizing the form and taking away the taskbar is not really what I'm looking for. I just need to know if I can change the moniter resolution as easily as any of the Direct X reference libraries. And a push in the right direction.
View 5 RepliesWhat i am trying to do is open a save file dialog and write to a .txt firl the contents of my listview. so far:
[Code]...
i have this, but i'm not to sure how to write to the .txt file i know i need to use a for each to loop the contents of the list view
I am using this, to read 1+ files from the openFileDialog, but I am having a problem getting just the file name, I can get the location "C:My Documentsfilename.jpg" but how do I get just the name "filename.jpg"?
I want to replace it with this line: can.Text = Regex.Replace(file, ".+\$", "")
vb.net
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
[Code]....
I understand how to associate my windows form application with a file extension (in my case, *.cmf). However, when the user double clicks on the file in, say Windows Explorer, the application opens but without the file being loaded. I also understand that this scripting (for the response to double clicking the file) can be defined by the My.Application.Startup Event, but I have not been able to find (in either this forum or MSDN) a clear example of what to do with the command line arguments after they passed to the application
View 3 RepliesI am working on a project and within that project I need to call on an already existing ocr file within vb 2008. I have tried to call the ocr in several mode
[Code]...
I have an app that works client cases and at one point they need to open a .MSG file that's been dragged into the case.
Right now it opens in Outlook. Sloppy and slow.
I would actually like to open and parse the data out of that file myself. Maybe put it into a richtextbox?
I want to put the program in a folder before I send it out, And it has several .txt files in the folder such as "How to use this" and "how to use that" I have a menustrip, And I have an option "How to use." < Whatever section there on.How would I make it so when they click that it will open up a .txt file from that folder which would be like" My program By ME " would be the folder name..I was thinking streamwriter or streamreader? But I can't understand how to use it.
View 13 RepliesI'm trying to open a .chm file in my VB solution using the following
Dim binWriter = New IO.BinaryWriter(IO.File.Create("help.chm"))
binWriter.Write(My.Resources.MyHelp)
binWriter.Close()
Process.Start("help.chm")
Everything works fine but when I click twice on the command button to open the chm I get the following exception:The process cannot access the file 'C:help.chm' because it is being used by another process.
On my computer I've set that when you try to open a txt file it opens it with my application. When I open a txt-file, the computer opens my program, but then is RichTextBox1 empty. (Of course, because I haven't set my program yet to show the content of the textfile in RichtextBox1.)
How do I make my program know from which file it's launched? So that it can load the content of the file using a StreamReader?
I want to find the full path of the program that will open a given file type. e.g. '.txt' is opened by c:windowssystem32 otepad.exe
I've done a bit of searching but i keep just finding how to create an association, not read one. I've also tried looking in the registery, but it looks like all that's there is a link to the program ID or something.
How would I be able to click on a label and make a text file open which would be save in the folder i sent out so something like
C:UserDesktopProgram FileRead me.txt
How would I also do the "user" part since I wont know everyone's computer user name that I send it to?
ok if there is any way to open a file from zip archive without extracting it ?
View 6 RepliesI am not so good with buffers and arrays and I dont know how to continue from here:
[Code]...
My intention is to open an image file as bytes, Convert the bytes to a string, send bytes to server and server stores bytes in a database. Then I need to reverse the process and be able to convert the bytes to an image.
I know this may sound a little wierd but I need to open file as bytes, convert bytes to string, encrypt the string, decrypt the string, convert the string to bytes and save.
I have been working on this for some time now and cant get it on working.This is my current mess for encypting the file:
[Code]...
I have an application which read data from Excel sheets when I drop them into one of apps forms.Is it possible to write an app. with which I will be able to use "Open file with", and the result will be the same as when I drop a file into a form?And is it also possible to add this option to the context menu strip of files with specified format?
View 12 RepliesI'm making a tiny program that calculates a total for a user for some type of styling service. A user clicks the radio button for either hairstyle, perm makeup, makeover, or manicure. then clicks a discount radio button, either none, 10% or 20%. then it calculates the total (price of service - discount %). then it displays the total in the current service text box & keeps a running total and displays that in a second total box.
My problem is i try to run the program i made and it basically crashes. In the code, when in VB, there's an error message when you go over PriceDecimal, DiscountDecimal, and GrandTotalDecimal saying the variable is used before it is assigned a value.also is there any way to open a .exe file and see the code for it?
Public Class ImageForm
' Declare module-level constants
Const MAKEOVER_PRICE_Decimal As Decimal = 125D
Const HAIRSTYLING_PRICE_Decimal As Decimal = 60D
[code]....
Currently i working on a project which needs an excel file to be opened at the rum time in Vb.net 2008.i tried to call the same using richtextbox, it shows the file but the content is not readable.
View 1 RepliesI am doing a project using Visual Basic 2008 (Windows Application). I need to show the results of my calculations in a Word (2007) document. I have a template (report) that contains the header/paragraphs/Tables.. What I need is to fill the blanks in this document using Visual Basic and insert pictures in that document.
View 1 RepliesHow would i open a text file which is hosted online, even with the url ending in .txt? When i try to open this in streamreader i get uri location is not supported.
View 2 RepliesAt home I use Visual Studio 2008 Pro but a class of mine is trying to have us use Visual basic 2005 express edition. Since we need to submit source code files will there be a problem if I just submit the .vb file instead of the whole solution?
[Code]...
I'm trying to open any file using Process.Start, but every time I try to open a file that isn't an executable the program crashes... This is the code I'm currently using:
vb.net
Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
For Each lvi As ListViewItem In ListView1.SelectedItems
Process.Start(path & "" & lvi.Text)
Next
End Sub
Path is a string that contains the selected folder path, and lvi is the text of the list view item (each item contains the icon and name of each file). It is working fine for .exe files, I was just wondering if it's JUST for .exe files...
I'm using Vb.net 2008 This code will open specific Excel file from specific location(C: a1.xlsx) and print data to it. Is it possible to open this file from any location(as when we use Process.Start("ta1.xlsx") )on Pc and complete the process of code( print datat)
vb
Dim exl As New Excel.Application
Dim exlWorkSheet As Excel.Worksheet
exl.Visible = True
[code]....
I have created an Excel AddIn that has a custom ribbon with some custom buttons...I'm using Excel 2010. One of the buttons is to save the the workbook by utilizing the users input as the file name. This workbook is to be saved as a template in a specified folder. The code also checks to see if the file already exists, and prompts the user to overwrite if it does already exist.The code I have seems to be working just fine. The problem is...when I try to open the newly saved workbook, it won't open.Here is the entire code for the button click event:
Dim Warning As DialogResult
m userFileName As String
Warning = MsgBox("Warning Message", vbOKCancel + vbCritical, "Warning Title")
[code]....
I would like to ask. I have saving to a text file down now with multiple lines and it works.
How do i open this text file into a label.I know about open file dialog which is the same as savefiledialog.
So how do i open the text file and display the text in a label with multiple lines using the one click of a button and a open file window thingy.Does anyone have code that could me with this.
I have ListView box with a file path for example
C: est.txt
So how can i open the C: So i just want to open the folder were the file is located and not the file its self.
I have a pdf that I want to be able to open when a button is clicked within the application that I have built in Visual Studio 2008 in .Net.
View 2 RepliesI have a problem on my project homework to make data CRUD files from drive which files upload using openfiledialog. my problem is I don't know source code how to open file from table, if I click path then open file (likes links url. I try to search but until now I can't found it.
View 1 Replies