|
form2 i added this code
public void HideTextBoxes()
{
textBox1.Visible = false;
}
this function can i call in form1
my problem is when i form1 to form2 i want hide form2 buttons or textboxes .
if separate i open form2 textboxes or buttons should visible
i code apply in form1 in submitbutton
form2.textbox1.visible=false;
but here when i click form1 to form2 , in form2 textbox1 visible .
|
|
|
|
|
Use delegates to create communication between forms, then an event in one form, can cause a method to be called in another.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Multiply ways to do this...
-in form2 declare a variable and decide on it's value
set it's value through constructor
-declare properties and user them
|
|
|
|
|
Hey,
I have a device for which I have to install the drivers. For this, I have the required .sys files as also the .inf file.
I wish to have the drivers installed before I plug in my device so that the "Found New Hardware" wizard can be avoided i.e. the device when plugged in for the very first time is recognised by windows and drivers are found installed.
Can anybody please guide me as I have not worked on device drivers earlier ?
Thanking you in anticipation.....
Regards,
modified on Sunday, March 22, 2009 2:30 PM
|
|
|
|
|
If the instructions for the device do not tell you how to do this, I would suggest that you are likely to encounter problems.
Why not just follow the instructions?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
i am having a text file of 10*10 integer datas...i am reading and writing into another textfile using readline method...but in this program i did some mistake...i couldn't get the output file with datas...here is the program
private void button1_Click(object sender, EventArgs e)
{
try
{
string path = "c:\\Vicky\\DATAS\\matrix.txt";
string path2 = "c:\\Vicky\\DATAS\\copy.txt";
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
FileStream fs1 = new FileStream(path2, FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs1);
string line;
while ((line = sr.ReadLine()) != null)
{
sw.WriteLine(line);
}
fs.Close();
sr.Close();
fs1.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|
|
That looks like File.Copy("c:\\Vicky\\DATAS\\matrix.txt", "c:\\Vicky\\DATAS\\copy.txt");
Anyway, you're closing the first stream twice. Remove sr.Close();
|
|
|
|
|
|
what is the format of the file?
|
|
|
|
|
.txt format..with full of image intensity values from 0 to 16000
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|
|
Ok, that's not helping though, what is the actual format?
Something like:
(({decimal string}; )+{newline})*
what does it look like
Seriously, this could be important.. Last modified: 49mins after originally posted --
|
|
|
|
|
You need to close your StreamWriter:
fs.Close();
sr.Close();
fs1.Close();
to:
fs.Close();
sr.Close();
sw.Close();
fs1.Close();
|
|
|
|
|
thanks man....i got it....
" Ella Pugalum iraivan oruvanukkae-A R Rahman "
|
|
|
|
|
Try this.
private void button1_Click(object sender, EventArgs e)
{
try
{
string path = "c:\\Vicky\\DATAS\\matrix.txt";
string path2 = "c:\\Vicky\\DATAS\\copy.txt";
using (StreamReader sr = new StreamReader(path))
using (StreamWriter sw = new StreamWriter(path2))
{
string line;
while ((line = sr.ReadLine()) != null)
{
sw.WriteLine(line);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
You don't need to close the files/streams because using will do it for you.
Even if there is an exception.
I suggest setting a breakpoint on the while and stepping through the loop a few times.
Regards
David R
|
|
|
|
|
Hi,
I can't see any obvious mistake in the code, so you should look for clues.
1) Does the input file contain the expected data
2) Do you get an output file. If yes is it empty
3) Does the output file timestamp get updated
4) Trace the code using the debugger and determine if the string variable 'line' contains the expected data from the input file.
Once you have done all of that come back to us and tell us what you have found.
Alan.
|
|
|
|
|
A general method for file copying, based on what you have, would look something like this:
bool FileCopy(string path1, string path2)
{
try
{
using (FileStream readFileStream = new FileStream(path1, FileMode.Open, FileAccess.Read))
{
using (StreamReader streamReader = new StreamReader(readFileStream))
{
using (FileStream writeFileStream = new FileStream(path2, FileMode.Create, FileAccess.Write))
{
using (StreamWriter streamWriter = new StreamWriter(writeFileStream))
{
string line;
while ((line = streamReader.ReadLine()) != null)
{
streamWriter.WriteLine(line);
}
}
}
}
}
return true;
}
catch
{
return false;
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Hi all
How to use streamreader class to read all occurances of a specific tag out of an HTML file
Example i want to read this tag << p >> onwards
This is some text in a paragraph.
How do i able to capture p ?
Thank You
|
|
|
|
|
Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find <p>.
|
|
|
|
|
How to type out the code?
=X
Thank You
|
|
|
|
|
What you mean?
|
|
|
|
|
U say
Easy way is to read each character and check it is the expected one. If yes, start reading from there. Other way is to read the whole file and use regular expression to find
So what is the coding to check if it is the expected one?
Thank You
|
|
|
|
|
You are highly unlikely to get a full code snippet. However, the regular expression you could try is along the lines of:
[<p>.*?</p>]{1,}
I'm a little rusty on regexs, so this may have unexplained behaviour
|
|
|
|
|
Hi,
need some help with application which should work like that:
when you turn on computer you see windows login screen, to the computer is connected smartcard reader, when you put the card it checks it. When it is ok windows login on a specific user.
or alternative version:
you login as a user, application in c# opens adn blocks mouse and keybord (fullscreen application i think. It asks user for a smart card and after checking it it unblocks computer.
if anybody have an idea how to make it (some code examples, maybe articles) I would really appriciate it
|
|
|
|
|
If Windows security isn't enough, you should probably only protect the particular applications you write.
|
|
|
|
|
this isn't about windows security.
on the smartcard is written student information and this is a way to check if student is present, save info about him etc.
and the side effect is that the application should block student account (in some way) to prevent using it without putting in the smartcard
|
|
|
|