Sorry to bothering you all. Can someone give me a hand here? How to insert value from a form into a class?
I have a form, called EnterKeyWindow. cs.
Then I have another .cs, called CarrierFile.cs
But then, it can run, but the value actually fail to insert into CarrierFile.cs. May I know what is the code to insert the value into the class??
Thanks in advance,
By
Aeris.
I have a form, called EnterKeyWindow. cs.
Code:
public CarrierFile carrierFile;
public EnterKeyWindow()
{
InitializeComponent();
this.carrierFile = new CarrierFile(imageSourceLocation,String.Empty, 0, 0);
}
public EnterKeyWindow(CarrierFile carrierFile):this()
{
this.carrierFile = carrierFile;
}
private void EnterKeyWindow_Load(object sender, EventArgs e)
{
FillCarrierFile();
}
private void FillCarrierFile()
{
carrierFile.SourceFileName = imageSourceLocation;
carrierFile.DestinationFileName = textBox1.Text;
carrierFile.CountBytesToHide = 0;
}
Code:
public class CarrierFile
{
public String SourceFileName;
public String DestinationFileName;
public Int32 CountBytesToHide;
public CarrierFile(String sourceFileName, String destinationFileName, Int32 countBytesToHide, int CountBitsToHidePerCarrierUnit)
{
this.SourceFileName = sourceFileName;
this.DestinationFileName = destinationFileName;
this.CountBytesToHide = countBytesToHide;
}
Thanks in advance,
By
Aeris.
Comment