|
Only ASP.NET has codebehind.
You should post code and the actual error message so we can work out what you mean. Use this and EventArgs.Empty to call an event, but I think it makes more sense to factor out the common code to a method.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi
after i unzip file and try to copy him, i get error process is used
by another program
what can be the problem ? (work on WinForm - C#)
ZipInputStream sampleInputStream = new ZipInputStream(File.OpenRead(UnZIP_ZipFile));
ZipEntry sampleFile = null;
string sampleOutputDirectoy = UnZIP_RegFile;
int sampleSize = 2048;
sampleInputStream.Password = "12345";
while ((sampleFile = sampleInputStream.GetNextEntry()) != null)
{
sampleSize = 2048;
if (Path.GetFileName(sampleFile.Name) != string.Empty)
{
string sampleFilePath = sampleOutputDirectoy + @"\" + sampleFile.Name;
FileStream sampleFileStream = File.Create(sampleFilePath);
byte[] sampleFileData = new byte[sampleSize];
while (true)
{
sampleSize = sampleInputStream.Read(sampleFileData, 0, sampleFileData.Length);
if (sampleSize > 0)
sampleFileStream.Write(sampleFileData, 0, sampleSize);
else
break;
}
sampleFileStream.Close();
sampleFileStream.Dispose();
}
}
sampleInputStream.Close();
sampleInputStream.Dispose();
MessageBox.Show(" ");
|
|
|
|
|
There is a problem in the first line. I leave it up to you to find and fix it.
BTW: "File in use by another program/process" isn't the best Windows message, it may well be (most often is) the same process causing the situation.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
I seem to be having trouble install these addins. I followed a tutorial on how to create a windows installer file for it (http://msdn.microsoft.com/en-us/library/cc563937.aspx[^])
Well when I install it, it installs but when you launch outlook you get an error about it not being able to find the vsto file. So I remove the addin from outlook because it isn't working, then I go to where it installed and double click that file to install it. Then it gives an error like this:
System.Net.WebException: Could not find file 'C:\Program Files\Arkansas Department of Emergency Management\ADEM Application - Outlook Plugin\OutlookPlugin.XmlSerializers.dll'
Now this plugin does use a web service but why is it giving this error?
Also on my computer it works fine when I right click on the setup project (in VS2008) and click install. Everything works great if I do that! But obviously I can't install VS2008 on everyones computer and install it that way LOL
Any help would be great.
BTW where is this XmlSerializers coming from? Why does it need it and why didn't VS2008 put it in there if it needed it?
|
|
|
|
|
This seems to be a common problem with deploying addins. It like it doesn't compile that? I tried the SGEN with no luck. The problem is because I'm using a web service. ANyone else have a idea?
|
|
|
|
|
Hello all,
i am trying to write develop file transfer using tftp protocol..
Can anyone share some of idea how to start with??
|
|
|
|
|
1) Open Visual Studio
2) Click File -> New Project
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Nah. Just open Notepad, and start typing:
using System;
using ...
PS: don't forget to provide comments.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
i hv senairo sucha as in a string variable contain some characters i want that using some function keyboard automatically typethis string in Textbox same as string variable contain
plz help me how this possible
|
|
|
|
|
YourTextBox.Text = YourStringVariable;
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
|
private void SomeFunction()
{
string var = "your string";
yourtextbox.focus();
SendKeys.Send(var);
}
|
|
|
|
|
Hi everyone.
I've got a listBox and a list of elements in it.
I've got another windows form, and it will be created after an item in the listBox is double clicked.
What I'm asking is;
I want to "read" the name of the element from the list box, and then fill the new form according to this information.
How can I pass the listBox1's selected Item's text to the new form?
can anybody help?
|
|
|
|
|
Create a constructor for the new form that takes the information necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Oh I've not created a constructor about 3 years, I don't remember how to but I'll try,
I'll try the articles
|
|
|
|
|
You need to research articles to create a class constructor?!?
Go read some books, take a class, whatever it takes but stop trying to write applications until you do.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ahhaah just never needed to create one until now =) (just graduated)
take it easy, thanks for help and advice
|
|
|
|
|
Just graduated? And this wasn't covered? Where did you graduate from?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
tatarrullaz wrote: just graduated
You should go right back to school. I'd written more constructors than I can count before I even started my first year at university. You have no excuse.
|
|
|
|
|
You can just simply write a custom property method for that.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
you mean a public class that can be reached from the new form?
is this it?
|
|
|
|
|
Yes, but it depends on how you are going to use the class... you can also use a constructor.
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
That would be awful IMHO if all you need is to send selected item. You should used a parameterized constructor. Or have a public event handler so that you can handle the double click event in the Form where you need to get the selected value.
Constructor would be the simplest way though.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
class Form2 {
private string m_Data;
internal Form2(string data) {
m_Data = data;
}
private void Form2_Load(...) {
Use m_Data here........
}
}
class Form1 {
private void ListBox1_DoubleClick(...) {
Form2 f2 = new Form2(ListBox1.SelectedText);
f2.Show();
}
}
|
|
|
|