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
K

Khoramdin

@Khoramdin
About
Posts
233
Topics
162
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Why am I getting this error "Attempted to read or write protected memory....."? [modified]
    K Khoramdin

    Hello everyone, I have a WebBrowser Control in Windows Application. As the user Navigate using the Web Browser Control if the site tries to open a new Window using script I get the following error.

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    I also tried the code given here http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx[^] and same error was given. I am using Visual Studio C# 2008. Can anyone tell me what is going on and how I can sort this out? Thank you very much for your help and have a great day. Khoramdin

    modified on Sunday, December 09, 2007 11:07:25 PM

    C# csharp help question c++ visual-studio

  • Strange behaviour of WebBrowser Control?!!!
    K Khoramdin

    Hello, Thanx for taking the time and trying to reproduct the problem. After my extensive search I found that is a known problem with VS2005. Please see the link http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2311412&SiteID=1[^] I am not sure why you were not able to reproduct the problem. It could be that you are using VS2008 as it has been suggested that the it doesn't suffer from the problem. For the time being suggestion to solve this issue is to use VS2008 or using AxWebBrowser control. Thank you very much and have a great weekend. Khoramdin

    C# question com adobe help

  • Strange behaviour of WebBrowser Control?!!!
    K Khoramdin

    Hello everyone, I have added a Web Browser Control to the my Windows Application using the following code:

    this.webBrowser1.Navigate("http://yahoo.com");

    As I am navagating the web using the WebBroweser Control, I have noticed that if the web-page contains Flash the mouse click works only ONCE. If I click the second time, nothing happens. I have noticed that I can get the mouse click working only for ONE click if I click on a button/tab or anything which is placed in Windows Application but it is not contained in WebBrowser Control. Can someone be kind enough to tell me what is going on and how I can sort this problem? Thank you very much and have a great weekend. Khoramdin

    C# question com adobe help

  • How to get the client IP address?
    K Khoramdin

    Hello everyone, I am trying to get the IP Address of the client so the application can hook itself up to it. I am using the following code:

        private void MyApplicationForm\_Load(object sender, EventArgs e)
        {
            string strIP = null;
    
            IPHostEntry HosyEntry = Dns.GetHostEntry((Dns.GetHostName()));
            if (HosyEntry.AddressList.Length > 0)
            {
                foreach (IPAddress ip in HosyEntry.AddressList)
                {
                    strIP = ip.ToString();
                    cmbInterfaces.Items.Add(strIP);
                }
            }            
        }
    

    When I run the application on my PC which is connected via a cable to a routher I only get on IP address which is the internal IP address. But when I run the Application on my laptop which is using Wireless Connection to the same routher I get list of few IP addresses. Can someone tell me why this is the case and how can I make sure I only the IP address that my laptop is set to rather than the list of the IP addresses. Thank you very much and have a great day.

    C# question tutorial

  • How to catch the text between two boundaries?
    K Khoramdin

    Hello, I am kind of new with regular expressions. As far as I search over the internet I couldn't find a resonable solution. Suppose I have the following in a string: Word0 word1 word2 word3 word4 word5 word6 word7 word8 word9 How can I capture the following? word4 word5 word6 word7 I would like to catch the text between TWO boundries word4 and word7. I`ve tried a lot of things none of them works. Thank you very much for your help and have a great day. Khoramdin

    C# question help tutorial

  • How to convert ASCII to readable characters?
    K Khoramdin

    Hello everyone, I have an array which holds ASCII codes. How can I convert this to characters that I read?! ;P Thank you very much and have a great weekend. Khoramdin

    C# question data-structures tutorial

  • WebBrowser Control and HTTP requestes to server question
    K Khoramdin

    No, I started the work on BHO and then when I couldn't get the HTTP request moved to HTTP Sniffer. Then I heard from someone that I should be able to capture the HTTP requests using the BHO and that is why I thought to come and ask since when I looked for information about that, I could not find any. I wish I was that clever, mate! :laugh: The HTTP sniffer that I managed to put together is based on many articles that I found online such as http://www.c-sharpcorner.com/UploadFile/leonidmolochniy/SimpleSnifferInCS11222005232804PM/SimpleSnifferInCS.aspx[^] Regarding what you said about URL address in TCP. If each packet doesn't hold all the information the how do they know where to start and where to end regarding the connection and file transformation? Thank you, Khoramdin

    C# question sysadmin

  • WebBrowser Control and HTTP requestes to server question
    K Khoramdin

    Hello david, Thank you for your reply. I am also wroking on a HTTP Sniffer which and after I create a socket using the Socket class as following:

    mySocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);

    After I receive the packets, I try to analyze it by first placing the packet in memory. The packets are sorted based on thier ProtocalType into TCP, UDP and I am able to get information such as Version, HeaderLength, TotalLength, and so on for both the protocals. My question is where should I look to get the URL address of the HTTP requests? If I am not mistaken the information should be available in HTTP Header rather than IP Header, TCP Header, or UDP Header! Am I on the right track or I am way off and need to re-think this? Any information on this, is grealy appriciated Dave. As always, thank you so much for your help and have a wonderful day. Khoramddin

    C# question sysadmin

  • WebBrowser Control and HTTP requestes to server question
    K Khoramdin

    Hello everyone, I am using WebBrowser Control and when I check all the supported properties, methods, and events associated with the WebBrowser and InternetExplorer objects; I don't see anything that can be used to catch the HTTP requests! I am able to get the URL address for a website using DocumentComplete (Fires when a document is completely loaded and initialized) or get the Client Entered information such as username, password and so on using BeforeNavigate2 (Fires before navigation occurs in the given object. My undrestanding is that for every object such as images a HTTP request is sent to the server. Then the question is how can I get/monitor all these requests? Any information on this is greatly appriciated. Thank you and have a great day. Khoramdin

    C# question sysadmin

  • How can I get the URL address for a TCP Packet?
    K Khoramdin

    Hello everyone, I am working on a HTTP Sniffer. So far I am able to get some information on a TCP received packet using the following code.

    //Create MemoryStream out of the received bytes
    MemoryStream ImemoryStream = new MemoryStream(byteBuffer, 0, nReceived);
    //Next we create a BinaryReader out of the MemoryStream
    BinaryReader IbinaryReader = new BinaryReader(ImemoryStream);

                //The first eight bits of the IP header contain the version and
                //header length so we read them
                byteVersionAndHeaderLength = IbinaryReader.ReadByte();
    
                //The next eight bits contain the Differentiated services
                byteDifferentiatedServices = IbinaryReader.ReadByte();
    
                //Next eight bits hold the total length of the datagram
                ushortTotalLength = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());
    
                //Next sixteen have the identification bytes
                ushortIdentification = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());
    
                //Next sixteen bits contain the flags and fragmentation offset
                ushortFlagsAndOffset = (ushort)IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());
    
                //Next eight bits have the TTL value
                byteTTL = IbinaryReader.ReadByte();
    
                //Next eight represnts the protocol encapsulated in the datagram
                byteProtocol = IbinaryReader.ReadByte();
    
                //Next sixteen bits contain the checksum of the header
                ushortChecksum = IPAddress.NetworkToHostOrder(IbinaryReader.ReadInt16());
    
                //Next thirty two bits have the source IP address
                uintSourceIPAddress = (uint)(IbinaryReader.ReadInt32());
    
                //Next thirty two hold the destination IP address
                uintDestinationIPAddress = (uint)(IbinaryReader.ReadInt32());
    

    I also need to get the URL address of where the packet are comming from. I have seen some comercial HTTP Sniffer being able to do that. The Sniffer80 available in http://www.codeproject.com/tools/sniffer80.asp[^] also can capture the URL address of the packet. Can someone tell me how I can get this done? Maybe I am looking for a URL address at the wrong pla

    C# question csharp com tools announcement

  • Request made to the server from Web Browser Control?
    K Khoramdin

    Hello everyone, I am working on hooking to a Web Browser Control in my Windows Application. For example the following code is used to display the typed password or get the web address of the site.

    public void OnBeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel)
    {
    document = (HTMLDocument)webBrowser.Document;

            foreach (IHTMLInputElement tempElement in document.getElementsByTagName("INPUT"))
            {
                if (tempElement.type.ToLower() == "password" && tempElement.value.ToString() != "")
                {
                    MessageBox.Show("You typed '" + tempElement.value + "' for your Password");
                }
            }
        }
    

    .
    .
    .
    public void OnDocumentComplete(object pDisp, ref object URL)
    {
    MessageBox.Show(URL.ToString());
    }

    The problem is that not all website Navagate from one page to another page and eventhough requests are still made to the server but there no navagation to a new URL address. For example when I get to site build in Flash. Can someone tell me how I can monitor the request made to the server? Thank you for your help. Khoramdin -- modified at 13:11 Sunday 25th November, 2007

    C# help adobe sysadmin tutorial question

  • General Question on Browser Helper Object (BHO)
    K Khoramdin

    Hello everyone, I am working on a Browser Helper Object and so far I have been able to hook to HTML document elements. My question is, is it possible to hook to Flash Objects in the HTML? For example would it be possible to detect if a Button in Flash environment has been click?! Any information on this would be great. Thank you and happy thanks-giving everyone. Khoramdin

    C# question html adobe tutorial lounge

  • How can I catch the Mouse Click?
    K Khoramdin

    ha ha ha... I wish someone had solved it for me, mate! I truly cracked my head on that BHO and believe me when I tell you that I was so excited when it got working! I cannot deny the fact that I read nearly a milliion posting and articles before I managed to get it up and running. I am actually thinking of creating a STEP BY STEP and detailed tutorial and submit it to codeproject regarding the BHO. My finding was that, expect one or two articles; there isn't much of information on BHO on Internet. It is good to see you have a delightful sense of humor. Happy thanx-giving, mate.:rose: Khoramdin

    C# question csharp

  • How can I catch the Mouse Click?
    K Khoramdin

    Hello, You should POST the entire message rather than posting one section of it. If I remeber correctly, I said "If my messages bother you so much I surly can stop and take my postings and problems to another forum.". That is if you wish to be fare, mate! I still stand by my posting as I am not here to upset anyone. By the way, didn't take your advise and managed to solve the problem. Hey, not all of use get Free MVP title! *wink* Thank you for the reply. Khoramdin

    C# question csharp

  • how I can insert image into sqlserver database with c#
    K Khoramdin

    Hello yemen_programmer, As far as I know, there are TWO ways to do so. 1- To store only the location of the image into your database and the image file in a different folder. 2- To store the image file as a BLOB file. The option 1 is stright forward as you only store a text into your database while your image sits in a folder. Therefore, I am going to leave that. The second option can be done with a code similar to the one here. Keep in mind that this line of code uses MySQL database and the command line "INSERT INTO ....." may be different for SQL and you need to check that out. I personaly use MySQL. The following code also includes storing other information about the stored image. But the most important one that you require is ItemImage and ImgeSize. OdbcCom = new System.Data.Odbc.OdbcCommand("INSERT INTO item VALUES (NULL, ?, ?, ?, ?);", OdbcCon); OdbcCom.Parameters.Add("@ItemName", System.Data.Odbc.OdbcType.VarChar); OdbcCom.Parameters["@ItemName"].Value = txtItemName.Text; OdbcCom.Parameters.Add("@ItemImage", System.Data.Odbc.OdbcType.Image); OdbcCom.Parameters["@ItemImage"].Value = ImageArray; OdbcCom.Parameters.Add("@ImageSize", System.Data.Odbc.OdbcType.Int); OdbcCom.Parameters["@ImageSize"].Value = FileSize; OdbcCom.Parameters.Add("@ItemInfo", System.Data.Odbc.OdbcType.VarChar); OdbcCom.Parameters["@ItemInfo"].Value = txtItemInfo.Text; OdbcCom.ExecuteNonQuery(); Keep in mind that before being able to do so, you need to place your image in an Array which in the above code is called ImageArray. I hope that could help you out to get your image into your database. Cheers, Khoramdin -- modified at 14:49 Wednesday 21st November, 2007

    C# csharp database

  • How can I catch the Mouse Click?
    K Khoramdin

    Hello everyone, I have created a BHO using C#. The code works fine. I would like to detect mouse click on a particular bytton. The following is the SiteSet(). public class BHO : IObjectWithSite { private SHDocVw.WebBrowser webBrowser; private mshtml.HTMLDocument document; private mshtml.IHTMLDocument2 document2; private mshtml.HTMLElementEvents_Event events; public int SetSite(object site) { if (site != null) { webBrowser = (SHDocVw.WebBrowser)site; webBrowser.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete); webBrowser.BeforeNavigate2 += new SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHandler(this.OnBeforeNavigate2); webBrowser.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler(this.OnQuit); webBrowser.NavigateComplete2 += new SHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(this.NavigateComplete2); events.onclick += new mshtml.HTMLElementEvents_onclickEventHandler(this.OnElementMouseClick); } for the OnElementMouseClick function I have the following. public bool OnElementMouseClick() { MessageBox.Show("HelloWorld..."); return true; } . . . . But nothing really happens! Am I wrong to think that the above code should give me HelloWorld message once a button is click? Any information on this would be appriciated. Thank you very much. Khoramdin

    C# question csharp

  • General Questions using Attach Process [modified]
    K Khoramdin

    Hello everyone, I am working on a BHO and created a Class Library. I am using the Attach Process (Tools -> Attach Process...) to attach my Class Library Assembly(MyProject.dll and Interop.SHDocVw.dll) to the running process. My question is, using Windows Module (Debug -> Windows -> Modules) should I be able to see the two mentioned dll files also loaded? I think I should but would like to know your opinion on this. If this is not the right way to check what file has been attached then how can I check to see what has been attached to the running process? I ask since when I use the mentioned approach I don't see any of the mentioned DLL file loaded which leaves me with the question: "What has been attached/loaded then?!!!" I don't have to register the BHO if I am using Attach Process approach to attach the Assembly. Do I have to? I don't think I should since I am attaching it manually but I was told by someone that I should but I am not 100% sure on that. What do you think? Thank you very much for all your help. Khoramdin -- modified at 12:41 Monday 19th November, 2007

    C# question com debugging tools help

  • General question Class Library project
    K Khoramdin

    Hello Colin, Thanx for the reply. You are absolutly correct if the Class Library was created for an exsisting project. I am not able to do so since the Class Library is for creating a Browser Helper Object (BHO). That is why I am using Attach Process to attach it to IE Browser. I am trying to undrestand the way Class Library works in Visual Studio, so I can solve the issue I am currently facing. Thank you for taking the time and respond. Any information in regard with this is greatdly appriciated, Colin. Have a great weekend. Khoramdin

    C# question debugging lounge

  • General question Class Library project
    K Khoramdin

    Hello everyone, I am trying to debug a Class Library. My question is: Once the Class Library project is built and attached to a running process; using Module Windows, should I be able to see that MyProject.DLL file has been loaded? Any information on attaching and debuging a Class Library project to a running process will greatly be appriciated. Thank you very much and have a great day. Khoramdin -- modified at 12:18 Sunday 18th November, 2007

    C# question debugging lounge

  • Problem Getting C# BHO To Work
    K Khoramdin

    Hello Mark, Thanx for your reply. Now, I know that my messages can be read by other! *wink* By the way, if it bothers you so much that I post here, I surly can stop and take my postings and problems to another forum since I don't mean to upset anyone. Since you have been readin my posting, then you should know by know, that they are on the same subject but as I am spending more time reading about the issue, they are changing since I feel as I am getting closer to the source of the problem. :) I was wondering if you got the MVP title by very same approach of moving to the next topic once you are stuck on one?!!! *wink* Since we are on the same topic, let me ask you this. When a Class Library is Attached to a running process, then I guess I should NOT be able to delete the dll file since that file should be loaded and used with the running poccess? In my case I can delete the WebWatcher.dll file and that makes me think if the file is actually been attached! What are your thoughts on this? Any information would be appriciated, mate. Happy thanx-giving, mate. khoramdin -- modified at 18:39 Saturday 17th November, 2007

    C# csharp visual-studio debugging help
  • Login

  • Don't have an account? Register

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