|
Seriously, you need to stop asking questions like this here. Don't compound the error by asking for a free download of a (presumable not free) book.
Google for c# beginner's tutorials: they'll do you far more good than any book at the outset.
|
|
|
|
|
Everyone learns in different ways. You need to go to Amazon, read the reviews and work it out for yourself.
If you want free try Learn Visual C#[^]
"You get that on the big jobs."
|
|
|
|
|
Try to found Balagoswamy C# book, its a core c# book available in the market
If you have any problem in c# contact me on my mail
Thanks
Kumar Ashish
|
|
|
|
|
|
sir actualy i am passing one form reference in constructor to use its control in another form but i am not getting the control of first form in second form .......
please provide some solution
|
|
|
|
|
Although it is hard to guess without seeing your code, I think that the most probale reason is, that the control in question is private. So, to access the control from the second form, just set the control to public or provide public accessor in the first form.
|
|
|
|
|
That doesn't sound like a good way to do it. You likely want the second form to have an event and have the first form register a handler for that event.
|
|
|
|
|
See my article on events here[^] for a better method than constructor injection, in particular the section "Form Communication Using Events".
|
|
|
|
|
BasePriority = 'process.BasePriority' threw an exception of type 'System.InvalidOperationException'...This is the exception I am getting while restoring the database from my .net application..Here I am providing the code....
try
{
string path;
path = filetext.Text;
StreamReader file = new StreamReader(path);
string input = file.ReadToEnd();
file.Close();
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = @"C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin\mysqlimport.exe";
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = false;
psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}",
userid, paswd, server, comboBox1.Text);
psi.UseShellExecute = false;
Console.WriteLine(psi);
Process process = Process.Start(psi);
process.StandardInput.WriteLine(input);
process.StandardInput.Close();
process.WaitForExit();
process.Close();
MessageBox.Show("database is restored");
}
catch (IOException ex)
{
MessageBox.Show("Error , unable to Restore!");
}
Plz provide any suggestion....
|
|
|
|
|
You cannot set the BasePriorty as this is a read only Property.
The return type of this property is an integer. Read more about this here[^] .
You have not provided the code for this statement, so its hard to figure out what you were trying to do.
|
|
|
|
|
|
As pointer reach to line Process process=process.start(psi), command line windows opens for a second and then closes and when after this line I watch the output it throws that exception that process has existed....
|
|
|
|
|
Yeah, I don't see such a statement, but maybe you need something like this:
try
{
process.PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal ;
}
catch
{
/* The process probably already exited due to error */
}
|
|
|
|
|
yes sir process is already exiting due to error .........i am also unable to understand why the process is exiting ...give some solution thanks
|
|
|
|
|
You'll need to check the output. You may need to redirect and capture the output.
|
|
|
|
|
how i can do this ....provide what code i should use or steps to do that thanks in advance
|
|
|
|
|
You can print reports that personal information, now I hit the print icon in the report and display the print dialog box has two buttons ok and cancel, if you click ok it will print, but how do you know that have hit the ok button? Thank you very much.
|
|
|
|
|
Try:
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog() == DialogResult.OK)
{
....
}
BTW: Please do not post subjects in Vietnamese (or other languages) - most readers cannot understand it, so you reduce your chances of getting help. Google translate does a pretty good job:
Bắt sự kiện nút ok của hộp thoại print
Getting event print dialog's ok button
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi , have a good day ,
I have Paired Nokia Mobile with my PC Windows 7 64 bit , through bluetooth
And Every thing works fine , Contacts , Messages , File Transfer ,
Even after I restart My PC or Turn my Mobile Bluetooh off/On , they connected Automatically ..
Except , one thing the "Telephony Audio Gateway!"
It does not Connect automatically , I have to press Connect Button from my PC Bluetooth settings , every time they connected again !
Setting Picture[^]
Thank you .
|
|
|
|
|
What does this have to do with C#?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Contact Nokia? Sounds like a user-problem, not programming-related.
Bastard Programmer from Hell
|
|
|
|
|
Nokia Restricted my country from accessing there web site
|
|
|
|
|
It is my understanding that the plug-in that would facilitate developing for the Blackberry has been retired. What tools, software,etc. are presently available to do so? Guidance sought
|
|
|
|
|
mauricemcse wrote: Guidance sought
Uhm... use this
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
im trying to upload,save the image and then want to move the image to another folder...
only when the control goes to move function i get this error (The process cannot access the file because it is being used by another process.)
//this is my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OnBarcode.Barcode.BarcodeScanner;
using System.Drawing.Imaging;
using System.Diagnostics;
using System.IO;
namespace AutoImageProcessing
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "*.jpg|*.jpg";
ofd.Multiselect = false;
ofd.Title = "Select JPEG File";
if (ofd.ShowDialog() == DialogResult.OK)
{
textBox1.Text = ofd.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
string path = textBox1.Text;
//->if (textBox1.Text != string.Empty)
if (path != string.Empty)
{
try
{
pictureBox1.Image = Image.FromFile(path);
//->String[] barcodes = BarcodeScanner.Scan(textBox1.Text, BarcodeType.All);
String[] barcodes = BarcodeScanner.Scan(path, BarcodeType.All);
// MessageBox.Show(barcodes[0]);
// Specify a "currently active folder"
//string activeDir = @"f:";
//Create a new subfolder under the current active folder
//string newPath1 = System.IO.Path.Combine(activeDir, "export");
string newPath = @"f:/export/" + barcodes[1];
//string newPath = System.IO.Path.Combine(activeDir1, barcodes[1]);
// Create the subfolder
System.IO.Directory.CreateDirectory(newPath);
// Create a new file name. This example generates
// a random string.
string newFileName = barcodes[1];
// Combine the new file name with the path
newPath = System.IO.Path.Combine(newPath, newFileName);
//cropping the signature and photograph
//saving the 2 cropped images into the folder
if (!System.IO.File.Exists(newPath))
{
try
{
Point start = new Point();
Point end = new Point();
int width;
int height;
using (Bitmap bitmap = new Bitmap(pictureBox1.Image))
{
bitmap.Save(newPath + ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
bitmap.Dispose();
}
MessageBox.Show("image saved!!!");
start.X = 305;
start.Y = 489;
end.X = 843;
end.Y = 569;
width = 538;
height = 80;
Rectangle imageRectangle = new Rectangle(start.X, start.Y, width, height);
if (start == new Point(0, 0) || end == new Point(0, 0))
{
MessageBox.Show("First select start and end point by clicking on the image");
}
else
{
try
{
pictureBox1.Image = cropImage(pictureBox1.Image, imageRectangle);
using (Bitmap bitmap = new Bitmap(pictureBox1.Image))
{
bitmap.Save(newPath + "_barcode.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
bitmap.Dispose();
}
MessageBox.Show("image saved!!!");
}
catch (Exception ex)
{
MessageBox.Show("this is the error \n" + ex.Message);
}
}
}
catch (Exception ex)
{
MessageBox.Show("An Error has occured: \n" + ex.Message);
}
}
}
catch (Exception ex)
{
MessageBox.Show("An Error has occured: \n" + ex.Message);
return;
}
}
else
{
MessageBox.Show("Please Enter Location of Image");
}
try
{
Image.FromFile(path).Dispose();
MessageBox.Show("entering move function");
Process end=Process.GetCurrentProcess();
MessageBox.Show(end.ToString());
end.Dispose();
end.Close();
}
catch(IOException w)
{
MessageBox.Show("error"+w.Message);
}
try
{
System.IO.File.Move(path, @"f:\img_pr");
MessageBox.Show("move completed");
}
catch (IOException w)
{
MessageBox.Show("error" + w.Message);
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private Image cropImage(Image image, Rectangle imageRectangle)
{
Bitmap bitmap1 = new Bitmap(image);
Bitmap cropedBitmap = bitmap1.Clone(imageRectangle, bitmap1.PixelFormat);
return (Image)(cropedBitmap);
}
private Image bitmap2(Image image, Rectangle rectangle)
{
throw new NotImplementedException();
}
}
}
|
|
|
|