Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to edit and manage group policy through C# & ASP.Net ? Pin
Ibrahim Mostafa11-Nov-09 22:21
Ibrahim Mostafa11-Nov-09 22:21 
QuestionProblem in updating multiple rows of a single column with different values from C# Pin
Member 236780010-Nov-09 21:48
Member 236780010-Nov-09 21:48 
AnswerRe: Problem in updating multiple rows of a single column with different values from C# Pin
Dave Kreskowiak11-Nov-09 7:38
mveDave Kreskowiak11-Nov-09 7:38 
GeneralRe: Problem in updating multiple rows of a single column with different values from C# Pin
Member 236780011-Nov-09 8:17
Member 236780011-Nov-09 8:17 
QuestionProblems with VirtualMode of the DataGridView Pin
SquallNaruto10-Nov-09 20:46
SquallNaruto10-Nov-09 20:46 
AnswerRe: Problems with VirtualMode of the DataGridView Pin
SquallNaruto10-Nov-09 21:39
SquallNaruto10-Nov-09 21:39 
GeneralRe: Problems with VirtualMode of the DataGridView Pin
SquallNaruto10-Nov-09 22:44
SquallNaruto10-Nov-09 22:44 
Questionproblem with socket programing for image transformation Pin
mehrdad33310-Nov-09 20:40
mehrdad33310-Nov-09 20:40 
hi at first excuse me because of my poor english i have written a program for sending an image or for video conference via internet with sockets and i am using tcp protocols my problem is that when i test program on my computer it works fine but when i test it over internet with between two pcs the reciver cant recieve image correctly minwhile i am using dial up
connection i dont know where is the problem perhaps it is because of low speed of internet i changed the buffer size to 512 1024 4096 and it didnt change. or i maybe should compress or encode image i dont know .please please help me with this problem. Cry | :((
here is the code for sending an image :
private void button2_Click(object sender, EventArgs e)
{
byte[] bytes;

using (MemoryStream ms = new MemoryStream())
{
pictureBox1.Image.Save(ms,ImageFormat.Jpeg);
pictureBox2.Image = pictureBox1.Image;
bytes = ms.ToArray();
ms.Close();
}
startcapturing(bytes);
}
private void startcapturing(byte[] bytes)
{
int i = 0;
byte[] dataBuffer = new byte[128];
int index = 0;
byte[] loop = new byte[128];
loop = System.Text.Encoding.ASCII.GetBytes(((bytes.Length / 128) + 1).ToString());
label4.Text = ((bytes.Length / 128) + 1).ToString();
if (serverSocket != null)
{
try
{

rc = clientSocket.Send(loop, SocketFlags.None);
while(i<bytes.length)
{
="" for="" (index="0;" index="" <="" databuffer.length;="" index++)
="" if="" (i="">= bytes.Length)
{
dataBuffer[index] = 0;
}
else
{
dataBuffer[index] = bytes[i];
i++;
}

}
rc = lientSocket.Send(dataBuffer,SocketFlags.None);
}



}

catch (Exception err)
{
MessageBox.Show(err.Message.ToString()+"here");

}
}


}
here is the code for client to recieve image:
if (clientSocket != null)
{
while(true)
{
while (true)
{
int counter = 0;
msr = new MemoryStream();
byte[] recv = new byte[128];
try
{
rc = clientSocket.Receive(recv, SocketFlags.None);
try
{
counter = Convert.ToInt32(System.Text.Encoding.ASCII.GetString(recv, 0, recv.Length));
}
catch { }
while (counter > 0)
{

rc = clientSocket.Receive(recv, SocketFlags.None);
counter--;
msr.Write(recv, 0, recv.Length);

}
}
catch (Exception e)
{
}
try
{
pictureBox1.Image = Image.FromStream(msr);
msr.Close();
}
catch(Exception e)
{
}
break;
}
}
}
else
{
StatusLabel1.Text = "Unable to establish connection to server!";
BtnDC_Click(null, null);
}

}
i beg you help me Cry | :(( Sigh | :sigh: Frown | :(
AnswerRe: problem with socket programing for image transformation Pin
Paulo Zemek11-Nov-09 9:28
mvaPaulo Zemek11-Nov-09 9:28 
GeneralRe: problem with socket programing for image transformation Pin
mehrdad33311-Nov-09 19:58
mehrdad33311-Nov-09 19:58 
GeneralRe: problem with socket programing for image transformation Pin
Paulo Zemek12-Nov-09 12:24
mvaPaulo Zemek12-Nov-09 12:24 
GeneralRe: problem with socket programing for image transformation Pin
mehrdad33313-Nov-09 7:19
mehrdad33313-Nov-09 7:19 
QuestionHow to call unmanaged C++ DLL in C#.NET Pin
Pranav Thakur10-Nov-09 19:36
Pranav Thakur10-Nov-09 19:36 
AnswerRe: How to call unmanaged C++ DLL in C#.NET Pin
Christian Graus10-Nov-09 20:21
protectorChristian Graus10-Nov-09 20:21 
AnswerRe: How to call unmanaged C++ DLL in C#.NET Pin
Nicholas Butler11-Nov-09 1:24
sitebuilderNicholas Butler11-Nov-09 1:24 
GeneralRe: How to call unmanaged C++ DLL in C#.NET Pin
suzalinda3-Dec-09 12:50
suzalinda3-Dec-09 12:50 
QuestionWindows Form updating problem Pin
MathewPV10-Nov-09 19:06
MathewPV10-Nov-09 19:06 
AnswerRe: Windows Form updating problem Pin
Christian Graus10-Nov-09 19:35
protectorChristian Graus10-Nov-09 19:35 
QuestionListView annoying Pin
Xmen Real 10-Nov-09 19:00
professional Xmen Real 10-Nov-09 19:00 
QuestionOpening file with in its application Pin
Hum Dum10-Nov-09 18:21
Hum Dum10-Nov-09 18:21 
AnswerRe: Opening file with in its application Pin
Christian Graus10-Nov-09 18:32
protectorChristian Graus10-Nov-09 18:32 
GeneralRe: Opening file with in its application Pin
Hum Dum10-Nov-09 20:25
Hum Dum10-Nov-09 20:25 
AnswerRe: Opening file with in its application Pin
dan!sh 10-Nov-09 19:00
professional dan!sh 10-Nov-09 19:00 
GeneralRe: Opening file with in its application Pin
Hum Dum10-Nov-09 20:26
Hum Dum10-Nov-09 20:26 
AnswerRe: Opening file with in its application Pin
Luc Pattyn11-Nov-09 1:31
sitebuilderLuc Pattyn11-Nov-09 1:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.