473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Opening a notepad file for viewing in ReadOnly mode.

Hi
To open a notepad file, right now I am using Process.start. But this does not ensure that the file is opened in readonly mode

How can I make a notepad file open in Readonly mode

I do not want to change its attributes to Readonly
I do not want to open it in browser or in any other editor except notepad
I do not want to use MFCAppWizard of VC++ or VB to create my own editor.
I do not want to paste the text in some richtextbox control.(I am concerned with size. What if the file is real huge and textbox cannot accomodate it all)

Is there any way to open notepad editor without the menubar and ctrl+s option disabled?(So that User cannot perform Save operation)

Any pointers to how this can be achieved will be very useful. Please reply ASAP. I am working in VB.NET

TIA.
Nov 20 '05 #1
2 11129
In article <63**********************************@microsoft.co m>, Suma wrote:
Hi,
To open a notepad file, right now I am using Process.start. But this does not ensure that the file is opened in readonly mode.

How can I make a notepad file open in Readonly mode?

I do not want to change its attributes to Readonly.
I do not want to open it in browser or in any other editor except notepad.
I do not want to use MFCAppWizard of VC++ or VB to create my own editor.
I do not want to paste the text in some richtextbox control.(I am concerned with size. What if the file is real huge and textbox cannot accomodate it all).

Is there any way to open notepad editor without the menubar and ctrl+s option disabled?(So that User cannot perform Save operation).

Any pointers to how this can be achieved will be very useful. Please reply ASAP. I am working in VB.NET.

TIA.


Boy, that's a tall order. Basically, I don't think you can accomplish
what you want (at least not easily) - especially with the restrictions
you've laid down.

Hope you figure something out.
--
Tom Shelton [MVP]
Nov 20 '05 #2

"Suma" <an*******@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
Hi,
To open a notepad file, right now I am using Process.start. But this does not ensure that the file is opened in readonly mode.
How can I make a notepad file open in Readonly mode?

I do not want to change its attributes to Readonly.
I do not want to open it in browser or in any other editor except notepad.
I do not want to use MFCAppWizard of VC++ or VB to create my own editor.
I do not want to paste the text in some richtextbox control.(I am concerned with size. What if the file is real huge and textbox cannot
accomodate it all).
Is there any way to open notepad editor without the menubar and ctrl+s option disabled?(So that User cannot perform Save operation).
Any pointers to how this can be achieved will be very useful. Please reply ASAP. I am working in VB.NET.
TIA.


I have a suggestion that may work, unless I'm misunderstanding what you're
wanting to do. Instead of worrying whether user can alter your text file,
create a temporary copy of the text file and open that. Thus, the user can
change, save, or do whatever they want to the temp copy without affecting
your "real" copy of the text file.

Hope this helps
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: ajikoe | last post by:
Hello, I use windows notepad editor to write text. For example I write (in d:\myfile.txt): Helo World If I open it with python: FName = open(d:\myfile.txt,'r')
2
by: Greener | last post by:
In addition to the previous questions, I wonder, if opening an Excel file in NON-read-only mode, would the macros on the worksheets work as well? Thanks millions! Helena
5
by: PM | last post by:
Has anyone found a way to open a file exclusively where it will fail if the file is already open, i have tried the following _FileStream = new FileStream(@"C:\Data.txt", FileMode.Open,...
0
by: TdarTdar | last post by:
Hello, I was wondering if there is a way to used a dataview like the following and how to do it. I have a new table, no records. I have a new asp.net 2.0 beta 2 webform, with a sqldatasource...
21
by: Sender | last post by:
I have two questions: (1) I just want to check whether a .txt file is empty or not (without opening it). Like I click on a command button then it should give message EMPTY if is empty and show...
2
by: Ron | last post by:
Hello, the following sub (below) reads an excel file to a webpage using BinaryReader. If anyone tries to modify the excel file from the browser this places the excel file in ReadOnly mode, and...
4
by: Charlie Brookhart | last post by:
I am trying to write a code for a button click event. When the button is clicked, it is supposed to bring up an open file dialog box to allow the user to select the document they which to open....
18
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that...
5
by: =?Utf-8?B?bG9rZWU=?= | last post by:
Hello, I use windows XP ver.2002, Service pack 2. I am getting a very strange error. I am unable to open any file with extension".ini" If I create any text file, type some text and save it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.