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
V

Vodstok

@Vodstok
About
Posts
171
Topics
86
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Remote File Upload Through ASP .Net page
    V Vodstok

    The plot thickens. The page I will eventually have to call is written in JSP, which is of no immediate concern since the basic idea behind this requirement doesn't change, but here's where it gets interesting; the page I am calling uses JavaScript to set the cookies, and the page login immediately fails unless it's executed. So I'm not only not back to square one, it's not even on the horizon right now. Gotta love legacy products...

    ______________________ Oh Hamburgers!

    ASP.NET csharp help question

  • Remote File Upload Through ASP .Net page
    V Vodstok

    Most excellent, I am not quite there yet, but considering all of the annoying viewstate errors I am now getting (I appear to need the same machine key for both test sites) I am definitely getting farther than I was. I will update as soon as I get it figured out. Thank you again! This has been a huge help.

    ______________________ Oh Hamburgers!

    ASP.NET csharp help question

  • Remote File Upload Through ASP .Net page
    V Vodstok

    Okay, so I have a question; I am doing a get, scraping out the event validation and viewstate to send back, but when I try to post back to the page, I am getting what appears to be a non-posted page on the other end. Since I can't seem to reuse the original request, the page I get has different viewstate information, so I'm not getting the post I hoped (I think that is what is happening anyway). I am definitely hitting the page; I am doing a Response.Write for the returned content and it is definitely loading the correct page in the background. I seem to be back at square one (albeit using the baked-in features of 4.5, which is nice :)). So I am definitely calling the right page, but it does not appear to actually post. Here is the code I am using:

            //First call to get the hidden fields from the page
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(@"http://localhost:51749/Default.aspx");
            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
    
            HttpWebResponse resp = (HttpWebResponse)request.GetResponse();
    
            string respString = string.Empty;
    
            using (Stream strm = resp.GetResponseStream())
            {
                using (StreamReader sr = new StreamReader(strm))
                {
                    respString = sr.ReadToEnd();
                }
            }
            request = (HttpWebRequest)HttpWebRequest.Create(@"http://localhost:51749/Default.aspx");
            List controls = respString.Split('\\n').Select(o => o.Replace("\\r", string.Empty).Trim()).Where(o => o.StartsWith("<input") && o.IndexOf("hidden") > -1).ToList();
    
    
            request.Method = "POST";
            request.ContentType = "multipart/form-data";
    
    
            //copied from StackOverflow and updated to hit my URL
            using (HttpClient client = new HttpClient())
            {
                using (MultipartFormDataContent content = new MultipartFormDataContent())
                {
                    var values = new\[\]
                                    {
                                        new KeyValuePair("txtFile", "BALHHHHH"),
                                        new KeyValuePair("fu1", fileName),
                                    }.ToList();
    
                    foreach (string cont in controls)
                    {
                        List attributes = cont.Split(' ').Whe
    
    ASP.NET csharp help question

  • Remote File Upload Through ASP .Net page
    V Vodstok

    Excellent, I have definitely been missing that detail, Richard. I will give it a shot and let you know how it works :)

    ______________________ Oh Hamburgers!

    ASP.NET csharp help question

  • Remote File Upload Through ASP .Net page
    V Vodstok

    The new page is being built to integrate two old pages into a new interface, so for end users accustomed to the old functionality, they want to be able to present them with the message(s) that the old one did to minimize the changes in how they see things. Basically, it's out of my hands why, it's in the spec so I have to. There is a new solution in the works, but for the time being, I am tasked with making a new page that "operates" the old page in the background.

    ______________________ Oh Hamburgers!

    ASP.NET csharp help question

  • Remote File Upload Through ASP .Net page
    V Vodstok

    I have an interesting issue; I have been tasked with building a "one size fits all" file upload page. I am using C# and the 4.5 framework, so my options are wide open, but I have one problem in particular... Part of the requirement involves an old upload page; we already have a page that uses a regular file upload control with a button and it works exactly as expected. Here's what I need to do; the page I need to build needs to access the old page in the background and do the following: Upload the selected file Return the message displayed by the old page So I need to build a page that allows the user to select a file and "upload" it by accessing the older page in the background and pass the file and/or file information to it. I do not have access to the code of the old page, so I have to use the new page to handle all of the work. So far I have played with code I have found using HttpWebRequest,WebClient and even the .net libraries for cURL with no success. Has anyone tackled something similar in the past? Any suggestions?

    ______________________ Oh Hamburgers!

    ASP.NET csharp help question

  • Capturing a function
    V Vodstok

    Not exactly true; I have been hamstrung in the past like this and was able to capture the function and essentially add functionality to it, but that was a year ago and I sadly have no access to that code.

    ______________________ Oh Hamburgers!

    JavaScript javascript html database wpf wcf

  • Capturing a function
    V Vodstok

    I have a page where I need to trigger a function (I'll call hideBox) when another function (which I will call unChecked) is triggered. So let's say unChecked is called when a checkbox is clicked, as soon as unChecked runs, I need hideBox to run as well. The catch here is that i do not have access to the .js that holds the code for unChecked, and even if I did, I know it is being used by several other pages and I can't risk messing them up in the process. To further complicate things, I can't change any of the properties on the element that calls unChecked since the server side code is really picky about that sort of thing (the rest of the functionality breaks if I change any aspect of the input element. Needless to say, I did not write it.) I have tried just binding the event with jQuery, but jQuery actually changes the attribute array in the DOM, which screws up the post-back behavior. I have done this exact thing before, but that was using prototype, which isn't an option here (and was for another company so I can't go back and see what I did). Any ideas?

    ______________________ Oh Hamburgers!

    JavaScript javascript html database wpf wcf

  • Question about regular expression (for email addresses)
    V Vodstok

    I am working on a page with some email validation (classic asp) and I have a regex checking email addresses: ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w][^_]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$ This worked perfectly, it allows multiple periods in the domain name, hyphens, etc. I have one issue though, I need it to allow for single-character domains (like 3.com). I am not very skilled in regex.

    ______________________ Oh Hamburgers!

    Web Development regex com help question

  • Watir testing: Get type [modified]
    V Vodstok

    I am really hoping someone has good news on this because it will make my life way easier. i am writing a function in Watir for checking elements on a page to see if they are there. i am wondering if Watir has a way to "get type" on an element. So say I am passing "browser.image(:src,/happy.gif/)" to the def, is there a way to look at it and say "that is an img", or "that isnt a radio"? Edit: The answer is "yes" :D use .class, so "puts browser.image(:src,/happy.gif/).class" writes "Watir::Image" Good stuff :)

    ______________________ Oh Hamburgers!

    modified on Friday, October 31, 2008 11:57 AM

    Web Development testing beta-testing question announcement

  • "inhereting" a struct?
    V Vodstok

    That was why it was in quotes.

    ______________________ Oh Hamburgers!

    C# question

  • "inhereting" a struct?
    V Vodstok

    Awesome. The method mentione din the article is the one i went with. I created a class that handles the basics like converting and constructors, then inheret it with the other classes. Works like a charm :D

    ______________________ Oh Hamburgers!

    C# question

  • "inhereting" a struct?
    V Vodstok

    I have some classes I am writing that represent units of measurement, and I am trying to do this: each unit (Inch, Foot, Yard) is essentially a decimal, but has different properties, eg. a foot has 12 inches, a yard has 3 "foots" and 36 inches, so on. Is there a way to say "this class is a decimal" in a way similar to inheretence? I have tried using the same structure of a decimal, including all of the interfaces it inherets, but that was a god awful mess. Any ideas/suggestions?

    ______________________ Oh Hamburgers!

    C# question

  • Recieving posts without a web service
    V Vodstok

    Oh, I am absolutely aware that i will be duplicating my effort with this, it is just about providing options, as well as a healthy dose of preoffesional curiosity. I appreciate both of you giving me actual answers too, as opposed to "just use web services" or "why dont you just use web services?". You have no idea how good it feels to get that on a Monday :D

    ______________________ Oh Hamburgers!

    C# csharp java html database wcf

  • Recieving posts without a web service
    V Vodstok

    Awesome, thank you. I am looking it over right now, and it look slike it is the right direction. Thank you :)

    ______________________ Oh Hamburgers!

    C# csharp java html database wcf

  • Recieving posts without a web service
    V Vodstok

    This is mostly theoretical right now, but I am looking to see if this is possible: I am working on a web application that I want to be able to make available as a back-end to other web applications, but want to allow the ability to accept posts without using a webservice. Just as an example of what I am looking to do, I want to be able to take a regular HTML page with a submit control, and have the web application be able to accept, say, a string, and process that string. (something simple like save it to the database). I am familiar with web services in ASP .Net and will be using them as well, but I am looking to allow this alternate method as well. I have been googling it, but haven had much luck so far because its hard to get search engines to not be so literal :) I am aware of some Java web apps that do this, usually they process XML input.

    ______________________ Oh Hamburgers!

    C# csharp java html database wcf

  • Run program inside C# app.
    V Vodstok

    Wow, I just used the tabifier, that is exactly what I was looking for (and a bit more). Amazing program, thank you again :)

    ______________________ Oh Hamburgers!

    C# csharp question

  • Run program inside C# app.
    V Vodstok

    Looks like that may be exactly what I need :) thank you.

    ______________________ Oh Hamburgers!

    C# csharp question

  • Run program inside C# app.
    V Vodstok

    I have launched programs from a C# app before, but I have been wondering if it is possible to launch an application inside a C# app. So, what i am wondering is this, could i launch, say notepad o rmediaplayer, inside a C# app, so it would actually render inside the app? Or barring that, run as if they were part of it? Here is what I am looking to do: run applications inside a c# app so that i can minimize them to my system tray, even though they dont normally allow you to do so, so i could technically have notepad open in my tray, or mediaplayer, or even firefox. Is this even possible?

    ______________________ Oh Hamburgers!

    C# csharp question

  • Strange List<string> sorting request</string>
    V Vodstok

    the logic being used is very flexible and was designed to grab strings from any properties contained in a list of any objects. if you know the properties of the object (and you should at least one, otherwise you shouldn't be using it ;))and return the valu eof that property in each instance of the object in the list. Its hard to read, I know, but it works. the issue is that somewhere along the line, the data is getting out of sort, and I dont have time (yet) to add logic for sorting into the method. (it would have to identify the other property in the object to sort from, if such a property exists, blah blah blah) Why wouldnt i just access the property of each individual object in the list? Believe it or not, this was written to run through huge XML strings and grab the potential instances of object descriptions contained within, and then return the property values, if the objects exist, and if their properties arent null. I didnt design it, but I have to use it, so this method ignores the "what if" and just returns what is. And now i have to work with what comes out th eother side.

    ______________________ Oh Hamburgers!

    C# csharp linq algorithms regex tutorial
  • Login

  • Don't have an account? Register

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