Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

DeepOceans

@DeepOceans
About
Posts
45
Topics
32
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Bitmap to ByteArray Conversion...?
    D DeepOceans

    hi plz tell me the way to convert the Bitmap object to ByteArray in C#? I don't want to use the Memory stream as it causes problem with my System memory. reply me ASAP Regardz

    Shanzay

    C# csharp graphics performance help question

  • Low Virtual memory problem with Memory Stream?
    D DeepOceans

    Hi, I'm facing a problem while transmitting a live video on LAN using memory stream object. But when I run application,after some time,my system prompt me "Low virtual memory". Actually the reason is the Memory stream.As there are two ways to convert the BMP into Byte ARRAY i.e Stream or File so tell me any solution or any other better way to convert Bitmap object into ByteArray. Thanx and plzzzzzzzzzz reply

    Shanzay

    C# graphics data-structures performance help question

  • MultiCast Group range
    D DeepOceans

    Hi, I'm transmitting Live video over LAN by joining multicast group address "224.0.0.1".At client side, for receiving video I used same group address. I've read that multi Cast range is from 224.0.0.1 to 224.255.255.255 but I tested my server application with max. 3 clients. Can any one tell me the video which is transmitting at this address, How many systems can preview it. And what should be hardware constraints Regards,

    Shanzay

    C# sysadmin hardware

  • Memory Exception while saving an image
    D DeepOceans

    Hello I am working in C# and developing a desktop application. The main tasks of my application are Live Video Capturing, recording, transmission over LAN and motion detection. All are doing fine. But sometimes while grabbing a frame; it throws memory exception i-e "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" at line b.Save("C:\\abc.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);// b is a bitmap object ///// other code b.dispose(); and after that it throws exception i-e "A generic error occurred in GDI+". As I m continuously grabbing frames in a loop. So once it throws an exception, it stops working. I m searching over it but still didn't get any solution. plz help me out thx

    Shanzay

    C# graphics help csharp winforms algorithms

  • Timer Controll in Thread
    D DeepOceans

    I m using Timer to enable my function for grabbing the video frames on every tick. yes u might b right that thread does its work and exits but in my case it never actually goes in the function (i checked by printing a messegeBox). i already gave the code. plz try it and tell me more specific reason. Thanku so much !

    Shanzay

    C#

  • Timer Controll in Thread
    D DeepOceans

    Hello I m developing a window application. I m doing diferent tasks against different events using multi-threading. Against 1 thread , I m enabling the timer, and against its function I m performing 1 task, but it is not working i.e it is not executing the timer function. if I put all the code against some button rather than within thread , then it works well. plz tell me how could I use the Timer within the thread. here is my Code. private void Start_Click(object sender, EventArgs e) { pthrd = new Thread(new ThreadStart(Thrd1)); pthrd .Start(); } void Thrd1() { MessageBox.Show("Thread Start"); timer1.Enabled = true; } private void timer1_Tick(object sender, EventArgs e) { MessageBox.Show("Start Grabbing"); Calculate(); }

    Shanzay

    C#

  • Transmission of Video File
    D DeepOceans

    Hi, I'm transmitting recorded video file over LAN using UDP but sometimes file transmit successfully and sometimes at receiving side(client) it doesn't receive properly whereas at server side I get transmitting message. Please See my code and give me suggestion to overcome this problem. public void filercvold() { outStream = File.OpenWrite(filepath); bufOutStream = new BufferedStream(outStream); i=0; while (i<=fsize)//fsize is filesize { try { idsock.ReceiveFrom(rcvfilebuf, ref idep); bufOutStream.Write(rcvfilebuf, 0, rcvfilebuf.Length); i++; } catch (SocketException ttt) { MessageBox.Show(ttt.Message); } } bufOutStream.Flush(); bufOutStream.Close(); outStream.Close(); MessageBox.Show("File is completly received!!"); } //outStream is FileStream Object //bufOutStream is BufferedStream Object idsock is socket object // rcvfilebuf = new byte[16384]; 16KB packet Now whenever I got last msg "File is completly received" File fully saved and run properly. but when I dont get this msg as at server side I got transmitting msg but at same time at client side above notification doesn't show as client become stuck or remain in this statement " ReceiveFrom(rcvfilebuf, ref idep);" Now tell me how to check this or rcv full video every time as it doesnt happen everytime.By same code I got this msg and run video file at client but by same code above problem I face so what is main reason or where I'm doing wrong. Thanx in advance. Regards,

    Shanzay

    C# help sysadmin tutorial question

  • How to resolve this ERROR?
    D DeepOceans

    I'm trying to disconnect socket connection and then want to reuse again when any new client request comes but as I Press disconnect and Re-login then get following Error Message SocketException was unhandled. Message:"A blocking operation was interrupted by a call to WSACancelBlockingCall" ErrorCode:10004 Please help me out how to close socket properly so user re-login again successfully. Regards,

    Shanzay

    C# help tutorial question

  • avi to mpeg conversion in C#
    D DeepOceans

    Hi I m developing an application in C#. I m recording a video from Webcam and saving it on harddisk. it creates .avi file, which is very heavy file. so I want to convert it into .mpeg or any other format in which my video file is not as much heavy as .avi. so plz tell me the solution or code for conversion. Regardz

    Shanzay

    C# csharp

  • Thread abortion before closing form
    D DeepOceans

    How to return and what to return plz tell clearly :(

    Shanzay

    C# tutorial

  • Thread abortion before closing form
    D DeepOceans

    Yes I'm aborting thread as I didnt find any other method for closing thread.Plz Tell how to abort properly?

    Shanzay

    C# tutorial

  • Thread abortion before closing form
    D DeepOceans

    Hi, I am using multiple threads in my application and want to abort or close all threads when Exit application or click on Disconnect.But in my case as shown in code, thread status remain alive even I m aborting.Can any1 give me code snippset that how to abort thread successfully :

             try
                    {
                        // Client_Login clog = new Client_Login();
                        if (clog.clnt_th.IsAlive)
                        {
                            clog.clnt_th.Abort();//clog is other class object
                            clog.clnt_th.Join(1);
                        }
                         if (ClPb.thvidinfo.IsAlive)
                        {
                           ClPb.thvidinfo.Abort();//ClPb is other class object
                           ClPb.thvidinfo.Join(2);
    
                        }
                        if (ClPb.thvideofile.IsAlive)
                        {
                            ClPb.thvideofile.Abort();
                            ClPb.thvideofile.Join(3);
                        }
                       
                        if (thvideo.IsAlive)
                        {
                            thvideo.Abort();
                            thvideo.Join(4);
                        }
    
                    }
                    catch(System.Threading.ThreadAbortException thexp)
                    {
                        MessageBox.Show("Time worker thread was aborted: " + DateTime.Now.ToString(),thexp.Message );
    
                    }
    

    thvideo is parent thread and thvideofile and thvidinfo is its child threads.

    Shanzay

    C# tutorial

  • How to Enable a parent menu from child class?
    D DeepOceans

    Thank u so much. It did work now ;) Now plz tell me abt my 1 more prob. if u can. When I click Disconnect button it throws exception and application dont close all threads which are using in main as well as its other classes. private void bDisconect_Click(object sender, EventArgs e) { try { Client_Login clog = new Client_Login();//child class clog.clnt_th.Abort();//child class thread clog.sock.Close();//child socket function } catch(System.NullReferenceException expnul) { MessageBox.Show(expnul.Message); } } Here what is the main prob.? How to finish this thread exactly.

    Shanzay

    C# tutorial question

  • How to Enable a parent menu from child class?
    D DeepOceans

    I did it, but now it is giving error:Set object refrence exception..... Tell another solution.Plzzz

    Shanzay

    C# tutorial question

  • How to Enable a parent menu from child class?
    D DeepOceans

    Hi, I want to enable a menu, which is in main class, against any child class function but it is not activating. Instead If I enable it against any button of main class it becomes enable. as here udb-main is main class and from its button of start I open another form like: private void bstart_Click(object sender, EventArgs e) { UserLogin uslog = new UserLogin(); uslog.Show(); } Now in userlogin class login button I want to active main class activities menu against successful login.Here just relevant code is: private void bLogin_Click(object sender, EventArgs e) { DialogResult ds; ds = MessageBox.Show(" you are successfully login ","Login Success", MessageBoxButtons.OKCancel); if (ds == DialogResult.Cancel) this.Close(); else if (ds == DialogResult.OK) { udb-main hmain=new udb-main();// Main class **hmain.activitiesToolStripMenuItem.Enable=true;** hmain.hessloadfunc(); this.Close(); } } plz tell me how I can enable/disable any control from another class. Thanx.

    Shanzay

    C# tutorial question

  • Null Reference Exception while using threads
    D DeepOceans

    Gareth, clog is the object to access the control of thread which is use in other class and if I comment-out the clog aborting line then error on the thvideo.abort().Means error just come on abort() whatever thread I'm aborting.Got it?

    Shanzay

    C# help

  • Null Reference Exception while using threads
    D DeepOceans

    Hi I'm getting this error while trying to abort threads: "Object Reference Not set to an instance of an object" The code is: try { Client_Login clog = new Client_Login(); clog.clnt_th.Abort(); clog.sock.Close(); thvideo.Abort();//main class thread } catch(System.NullReferenceException expnul) { MessageBox.Show(expnul.Message); } plz help me out that How I abort my open threads as in above code some connection and threads are made in another class whereas the disconnect function is in main class.

    Shanzay

    C# help

  • Udp Broadcasting of video
    D DeepOceans

    Hi I've transmitted live video successfully from server to client using udp but now I want to broadcast video to all connected clients using broadcasting technique,here I'm getting problem in transmission of video frame but Multi msgs are broadcasting to all clients easily&successfully. Please tell me why one video frame which were easily sent before, when I didnt use broadcast option, not sending now? where can be problem as in same method I transmitted msgs but when tried to sent frame it didnt. Try to reply ASAP if any one knows. Thanx.

    Shanzay

    C# sysadmin help question

  • MultiClient Prob.
    D DeepOceans

    I want to send video file to multiclients from server using sockets in C# . As using threads I've successfully sent to multiclients but not simultaneously. If one client sends a request to server for a file, then server starts transmitting it and during that transmission if any other client sends request for file then 1st transmission got prob. and 2nd one also not initiated. plz help me out how to send file to multiclients simultaneously. Thanx.

    Shanzay

    C# csharp sysadmin help tutorial

  • Send Different Files to Different Clients at Same time
    D DeepOceans

    I used UDP protocol for sending Video files and by using streaming I m sending.At first Server Rcv one message for sending files then send file,the Code for sending file is as following using threads. private void liveVideoToolStripMenuItem_Click(object sender, EventArgs e) { try { Control.CheckForIllegalCrossThreadCalls = false; thvideo = new Thread(new ThreadStart(transmitVideo)); thvideo.IsBackground = true; thvideo.Start(); } catch (ThreadStartException thre) { MessageBox.Show(thre.Message); } } void transmitVideo() { /////////////////////////////////UDP //////////////////////////*/ filesndsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); ipd = new IPEndPoint(IPAddress.Any, 7090); filesndsock.Bind(ipd); MulticastOption moi = new MulticastOption(IPAddress.Parse("224.0.0.1")); filesndsock.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, moi); ipep = (EndPoint)ipd; while (true) { try { filesndsock.ReceiveFrom(rcvbuf, ref ipep); // Encoding and Viewing The Received Message msg = Encoding.ASCII.GetString(rcvbuf); //Server here receive msg from client for sending file MessageBox.Show(msg); try { thvideofile = new Thread(new ThreadStart(sendfile)); thvideofile.IsBackground = true; thvideofile.Start(); } catch (ThreadStartException thre) { MessageBox.Show(thre.Message); } } catch (Exception ee) { MessageBox.Show(this, ee.Message, "Unknown Exception"); } } } void sendfile() { if (dlgOpen.ShowDialog() == DialogResult.OK) { // create the raw streams inStream = File.OpenRead(dlgOpen.FileName); bufInStream = new BufferedStream(inStream); int bytesRead = 0; while ((bytesRead = bufInStream.Read(buf, 0, 16384)) > 0) { Thread.Sleep(20); filesndsock.SendTo(buf, bytesRead, SocketFlags.None, ipep); } } MessageBox.Show("File is completely transfered"); bufInStream.Close(); inStream.Close(); } But for sending same time to

    C# sysadmin
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups