Is the CO using GET or POST

Hi All,
One OAF concept question I have is : How can we tell by seeing a CO code , whether it uses a GET or POST method of submitting.
Thanks,
Srikanth

Hi Srikant.
Assuming the PR is being called by GET , do you mean to say that the page form values will be passed as through URL.YES.
Or a decision is taken at run time on the method based on the magnitude of form valuesMost probably NO. It will depend on browser whether it crashes or sends data or shows error message, IF the data is more than its CAPASITY.
URL specification itself does not put any length restrictions, but length restriction are put by browser and server. For ex, IE may be having max url size to 2k(Please confirm by googling exact lenghth for individual browser). Similar restriction is put by server also.
However in case of PUT, data is sent in header of packet, hence its size is usually much more larger,(Sufficient for near most of the cases)
So as much I know. No matter what the size of data is, in case of GET, its PR which is called. In case of POST, Its PFR.
More over.A form submit can be done by both GET AND POST. However OAF uses POST By default for form submission.
So again, even if data is submitted by GET, Its PR.AND if data is submitted by POST, its PFR which will be executed.
Decision of method (PF or PFR) is done by getting method type (GET OR POST).
Method type(GET or POST) is retrieved from HTTP header. (I did not find it documented anywhere that OAF gets method information from HTTP header, but there does not seems any other way possible.)
By the way Srikanth, why this doubt came to you that decision might be taken at runtime for large data submissions?
Abdul Wahid.

Similar Messages

  • Which http method to use- get or post???

    hi all.........
    i m trying 2 proceed URLs using httpclient with GetMethod & PostMethod. But i m confuse about that at which time which method i hav 2 use- getor post??
    The whole implementation of my code is done using j2se.
    It's so important part of my project. So plz help me...

    Random question to ask in these forums, you can do a simple google seach to find the difference between Get and Post.
    Basically Get will parse information at the end of your address, such data will be made public to see.
    e.g. www.mel.com?name=mel
    Post on the other hand stores the data inside the body of the html document, upon more things.
    Mel

  • Passing Parameter using GET or Post in J2ME

    I have a problem passing parameter which has space between character to Servlet through GET or POST method. I am using HttpConnection. Which works properly whenever i sending data without space, else it shows Exception for space in URL.
    If i use trim method which is Client side scrpiting then i am not able to update the database which takes input from the J2ME midlet.
    Can any1 help me how to pass the parameter with space.

    Hi Mark,
    The "number" format relies on the formats supported by the JS
    native Number object. We don't actually do any number parsing
    ourselves in Spry. One workaround, if you need things to sort
    properly, is to have one column that is formatted european numbers,
    and one column that is actually supported by the Number object. You
    can create this custom column by using a filter:
    function DataFilter(ds, row, rowIndex)
    row["@premieNumber"] = new
    Number(row["@premieNumber"].replace(/,/, "."));
    return row;
    Regarding the Request() object and your setURL() call ... the
    3rd arg to setURL is optional, and only necessary if you are going
    to use POST, or specify some header to send. If you do use post or
    want to send some specific header, the 3rd arg just has to be an
    object with only whatever options you want to specify, you don't
    have to specify them all ... the options names exactly match the
    fields defined in a Spry.Utils.loadURL.Request object.
    We do have a utility class that gathers all of the input
    values in a form. You will find it in Spry 1.6 in SpryUtils.js. The
    name of the function to call is:
    var str = Spry.Utils.extractParamsFromForm(form, elements);
    The 2nd arg is optional, and allows you to specify what
    element values you want to retrieve. If it is not specified, it
    gets all values in the form.
    --== Kin ==--

  • Send streaming password with GET or POST

    hi!
    we are using a plugin for protools which outputs a quicktime stream for our clients during recording sessions. this stream is password protected. since the client hearing/viewing this stream is already on a password protected site it would be nice to automatically log the user in the stream (to avoid that she has to enter user/passw a second time).
    is it possible to send the password with GET or POST (or another approach) to the quicktime plugin?
    unfortunately it is necessary to password-protect the stream since the url is always the same and another client could use the url to peep into the session.
    thanks in advance
    joerg

    hi!
    we are using a plugin for protools which outputs a quicktime stream for our clients during recording sessions. this stream is password protected. since the client hearing/viewing this stream is already on a password protected site it would be nice to automatically log the user in the stream (to avoid that she has to enter user/passw a second time).
    is it possible to send the password with GET or POST (or another approach) to the quicktime plugin?
    unfortunately it is necessary to password-protect the stream since the url is always the same and another client could use the url to peep into the session.
    thanks in advance
    joerg

  • Not able to change the password using FNDCPASS

    I am not able to change password using FNDCPASS. I am getting follwoing error while executing following command with APPLMGR user ( before that I have source the .env file ) (OS-Linux)
    [applmgr@ora11 /]$ FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME
    Log filename : L2741743.log
    Report filename : O2741743.out
    APP-FND-01630: Cannot open file L2741743.log for appending
    Cause: FDPFOP encountered an error when attempting to open file L2741743.log for appending.
    Action: Verify that the filename is correct and that the environment variables controlling that filename are correct.
    Action: If the file is opened in read mode, check that the file exists. Check that you have privileges to read the file in the file directory. Contact your system administrator to obtain read privileges.
    Action: If the file is opened in write or append mode, check that you have privileges to create and write files in the file directory. Contact your system administrator to obtain create and write privileges.
    Can some one pls guide me on this

    Duplicate post-
    Not able to change the password using FNDCPASS
    Please post only once.
    Thanks,

  • How do I change permissions for the documents and files on my Mac Book Pro after I re-instaalled the HD using a Time Machine back-up?

    I had to re-install the HD on my Mac Book Pro. I used a Time Machine back-up for all the apps and files. Most were restored, However, I cannot unlock a number of them. I tried changing the permissions using Get info but it is not working. I am using the latest version of Moutain Lion OSX.

    Linc:
    Very helpful suggestion and response, Thanks for pointing out that it is a permission issue. I am working through the issue and resolving my problem.

  • Posting period 011 2013 is not open while posting the document using F-02 getting the error

    Hi SAP Captains,
    Pls help me here.
    While posting the document using T-code F-02 getting the error "Posting period 011 2013 is not open.
    Please help me how to do, can you provide step by step.
    Rgds..Suresh

    Hi Suresh,
    You can search google and will get number of posts on this. This will lead to duplication of similar posts on forum.
    The message says "FI posting period is closed for 11th period of 2013". In which period you are trying to post the transaction?
    If it is past, open the FI posting periods in OB52.
    BR, Srinivas Salpala

  • Any guidelines using RSAL_LOG_WRITE to post message in the application log

    Hi SDN!
    I've programmed a rather complex extractor. As most you will know, the real test is when the extractor goes live in productions;-) So in order to be able to check if everything works as designed - I've customized the extractor in order to post more or less entries in the application logs - This setting can be alterered in the uses system directly.
    I've tested the functionality using RSA3 and the application log is filled as expected. The Application log object is RSFH and everything shows up fine. When tring to use it from BW - The application log gets no entries under object RSAP (Where they normally will end up).
    I'm using the function module RSAL_LOG_WRITE to add entries to the same log as the macroes LOG_WRITE uses.
    Does anybody have any experiance adding entries to the standard application log in the source system when extracting data into BW?
    Best Regards
    Søren Hansen

    Sorry Arkesh,
    I to don't know that how to install the jar files, actually thats the role of BASIS guys.
    Watch the below threads for which jar files we need to deploy and how to deploy the jar files
    Re: Required jar files for using jdbc adapter
    Re: Error in JDBC adapter

  • On some of my files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?" Then when I click "Locate", I get nothing.

    I'm really dumbfounded on this one and it's driving me bonkers!!!! On some of my music files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    This began to happen when Chuck made playlists2burn on2CD-and then he would delete the playlist; sending all the song files into oblivion. Certain songs have a ! right next to the file name, and as I stated before, i get that error message:
    "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    So I click on "Locate". No help. I get a menu with folders that say "catroot" and other folders which names I cannot remember, but I scroll PAST the file folders, & it's just a bunch of ".DLL" files.....I don't understand what any of the names of the folders mean...it's frustr8ing-coz this is my 2nd iTouch, my 1st one got stolen & I can't afford2buy my music back at this time & i NEVER before had a single problem with losing song file locations.
                  Is there anyone out there who has been through this frustrating game of chasing your tail?....<that's how I feel>
    If so I would be ever so gr8ful if maybe someone with the knowledge would be so kind as 2 tell me how/where 2 retrieve these songs & how to put everything back where it belongs, I would be 4ever gr8ful !!!
    I can't afford 2 replace the songs just like I'm unable 2 buy back my old music from my stolen iTouch....man that was an awesome collection-someday I'll be able 2 afford 2 do that & I would like 2 have all the new music that I paid 4 but cannot find when I got my new iTouch....that would just be  wonderful.
                 I hope someone sees this post that can help me retrieve these files....losing $100.00 of iTunes is a REAL BUMMER!!!!!!
                                                      ThanQ SO very much!
                                                                             [email protected] or [email protected] or [email protected] .
                                                                                               You can also find me on Facebook, my given name is Tiffinie Trimmer, &
                                                                                                that's my Facebook "handle".    ThanQ 4 taking the time 2 read all of this!
                                                                                                hope 2 get a reply someday....I'll B checking all my emails & my Facebook, as well
                                                                                                as marking this page in my FAVORITES so I can find it fast! Take Care!!!

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

  • I have been using Elements 12 without a problem for 9 months.  Now when I try to open the program, I get an error message  "Adobe Photoshop Elements 12 quit unexpectedly" and it will not open at all.  What can I do to open the program?

    I have been using Elements 12 without a problem for 9 months.  Now when I try to open the program, I get an error message  "Adobe Photoshop Elements 12 quit unexpectedly" and it will not open at all.  What can I do to open the program?

    Thank you for responding.  Nothing actually worked!  After reading the posts online, I called Apple.  They indicated they have seen problems with some software after their upgrades.  The technician was able to fix the problem on my computer remotely, but I have no clue what he did!  But, it was definitely related to their recent upgrade to my computer.

  • How to post and get data from server using Get Webrequest

    Hi:-)
    I'm trying to send a username and password argument my server and the server is suppose to send some string back. The following code, that I got of the web, just dies. I think this line:
    HttpWebRequestpreq = result.AsyncState
    asHttpWebRequest;
    is null. Can you kindly fix this for me? Thank you in advance:-)
    notes: I have a few textboxes with the values for the request params
    I'm targeting Windows Phone 8.0 and Windows Phone 8.1 devices
    privatevoidBtnSignUpSubmit_Tab(objectsender,
    RoutedEventArgse)
    //show error if Username == Username
    if(TbUN.Text.ToString() ==
    "Username")
    MessageBox.Show("You
    must fill in your Username in the Username textbox.\nThank you.");
    return;
    //make sure all fields are filled in
    if(TbUN.Text.ToString() ==
    ""|| TbPW.Text.ToString()
    == ""|| TbCPW.Text.ToString()
    == "")
    MessageBox.Show("All
    fields must be filled in.\nThank you.");
    return;
    //make sure Password is the same as Confirm Password
    if(TbPW.Text.CompareTo(TbCPW.Text) !=
    0)
    MessageBox.Show("Your
    Password should be the same as Confirm Password.\nThank you.");
    return;
    //make sure Username contains valid characters
    boolbValid = IsUsernameValid(TbUN.Text);
    if(bValid)
                    bSignUp =
    true;
    //disable textboxes
                    TbUN.IsEnabled =
    false;
                    TbPW.IsEnabled =
    false;
                    TbCPW.IsEnabled =
    false;
                    TbEmail.IsEnabled =
    false;
                    BtnSignUpSubmit.IsEnabled =
    false;
                    title.Text =
    "requesting...";
    //make Post request top-server
    //add parameters
    stringdata =
    "username="+TbUN.Text+"&Password="+TbPW.Text;
    if(TbEmail.Text.Contains("@")
    && TbEmail.Text.Contains("."))
                        data +=
    "&email="+ TbEmail.Text;
                    System.
    UriURL =
    newUri("http://www.iclips.co.za/RegisterUsernameAndPassword.php");
    WebRequestwebRequest =
    WebRequest.Create(URL);
                    webRequest.Method =
    "POST";
                    webRequest.ContentType =
    "application/x-www-form-urlencoded";
                    webRequest.ContentLength = data.Length;
    //we first obtain an input stream to which to write the body of the HTTP POST
                    webRequest.BeginGetRequestStream((
    IAsyncResultresult) =>
    HttpWebRequestpreq = result.AsyncState
    asHttpWebRequest;
    if(preq !=
    null)
    StreampostStream = preq.EndGetRequestStream(result);
    //guess one could just accept a byte[] [via function argument] for arbitrary data types - images, audio,...
    byte[] dataStream =
    Encoding.UTF8.GetBytes(data);
                            postStream.Write(dataStream, 0, dataStream.Length);
                            postStream.Close();
    //we can then finalize the request...
                            preq.BeginGetResponse((
    IAsyncResultfinal_result) =>
    HttpWebRequestreq = final_result.AsyncState
    asHttpWebRequest;
    if(req !=
    null)
    try
    //we call the success callback as long as we get a response stream
    WebResponseresponse = req.EndGetResponse(final_result);
                                        success_callback(response.GetResponseStream());
    catch(WebExceptionwe)
    //otherwise call the error/failure callback
                                        error_callback(we.Message);
    return;
                            }, preq);
                    }, URL);
    privatevoiderror_callback(stringp)
    if(bSignUp)
                    bSignUp =
    false;
    // Show error message
    MessageBox.Show("Connection
    Error!\n\n"+ p);
    //enable input
    //disable textboxes
                    TbUN.IsEnabled =
    true;
                    TbPW.IsEnabled =
    true;
                    TbCPW.IsEnabled =
    true;
                    TbEmail.IsEnabled =
    true;
                    BtnSignUpSubmit.IsEnabled =
    false;
                    title.Text =
    "try again";
    privatevoidsuccess_callback(Streamstream)
    if(bSignUp)
                    bSignUp =
    false;
    // Open the stream using a StreamReader for easy access.
    StreamReaderreader =
    newStreamReader(stream);
    // Read the content.
    stringresponse = reader.ReadToEnd();
    // Display the content.
    MessageBox.Show(response);
    // Clean up the streams.
                    reader.Close();

    // Directives
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Shell;
    using iClips.Resources;
    using System.ComponentModel;
    using System.Threading;
    using System.IO;
    using System.IO.IsolatedStorage;
    using Microsoft.Devices;
    using System.Windows.Media;
    using Microsoft.Xna.Framework.Media;
    using System.Windows.Media.Imaging;
    using System.Threading.Tasks;
    using System.Text;
    using Windows.Storage;
    using System.Windows.Threading;
    using System.Diagnostics;
    using System.Globalization;
    namespace iClips
    public partial class MainPage : PhoneApplicationPage
    Boolean bSignUp;
    HyperlinkButton BtnSignIn, BtnSignUp, BtnSignUpSubmit;
    TextBox TbUN, TbPW, TbCPW, TbEmail;
    TextBlock un, title;
    System.DateTime startTime;
    // Viewfinder for capturing video.
    private VideoBrush videoRecorderBrush;
    // Source and device for capturing video.
    private CaptureSource captureSource;
    private CaptureDevice vcDevice;
    double w, h;
    // File details for storing the recording.
    private IsolatedStorageFileStream isoVideoFile;
    private FileSink fileSink;
    private string isoVideoFileName = "CameraMovie.mp4";
    // For managing button and application state.
    private enum ButtonState { Initialized, Stopped, Ready, Recording, Playback, Paused, NoChange, CameraNotSupported };
    private ButtonState currentAppState;
    //create reference to SocketClient
    SocketClient sock = new SocketClient();
    // Constructor
    public MainPage()
    InitializeComponent();
    //setup recording
    // Prepare ApplicationBar and buttons.
    PhoneAppBar = (ApplicationBar)ApplicationBar;
    PhoneAppBar.IsVisible = true;
    StartRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);
    StopPlaybackRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[1]);
    StartPlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[2]);
    PausePlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[3]);
    //display a welcome message
    txtDebug.Text = "Welcome to iClips.";
    string result = sock.Connect("197.189.214.116", 5000);
    txtOutput.Text = result;
    if(result.Contains("success")){
    sock.Send("#testing_");
    SetScreenResolution();
    //set image on load friends
    /*Uri uri = new Uri("/Assets/home_icons/myFriends.png", UriKind.Relative);
    BitmapImage imgSource = new BitmapImage(uri);
    Image image = new Image();
    image.Source = imgSource;
    load_friends.Content = image;*/
    SignIn();
    private void SignIn()
    // remove all elements inside sign grid
    for (int index = MyGrid.Children.Count - 1; index >= 0; index--)
    MyGrid.Children.RemoveAt(index);
    BtnSignIn = new HyperlinkButton();
    BtnSignIn.Content = "<< Sign In >>";
    BtnSignIn.Click += new RoutedEventHandler(SignIn_Tab);
    BtnSignIn.VerticalAlignment = VerticalAlignment.Bottom;
    BtnSignUp = new HyperlinkButton();
    BtnSignUp.Content = "<< I'm new here. Sign Up. >>";
    BtnSignUp.Click += new RoutedEventHandler(SignUp_Tab);
    BtnSignUp.VerticalAlignment = VerticalAlignment.Bottom;
    un = new TextBlock();
    un.Text = "Enter your Username:";
    un.VerticalAlignment = VerticalAlignment.Bottom;
    un.HorizontalAlignment = HorizontalAlignment.Center;
    TextBlock pw = new TextBlock();
    pw.Text = "Enter your Password:";
    pw.VerticalAlignment = VerticalAlignment.Bottom;
    pw.HorizontalAlignment = HorizontalAlignment.Center;
    //setup username textbox
    TbUN = new TextBox();
    TbUN.Opacity = 0.5;
    TbUN.Text = "";
    TbUN.FontSize = 16;
    TbUN.FontWeight = FontWeights.ExtraBold;
    TbUN.Foreground = new SolidColorBrush(Colors.Black);
    TbUN.Background = new SolidColorBrush(Colors.Transparent);
    TbUN.VerticalAlignment = VerticalAlignment.Top;
    TbUN.Height = 70;
    TbUN.Tap += TbUN_Tap;
    //setup password textbox
    TbPW = new TextBox();
    TbPW.Opacity = 0.5;
    TbPW.Text = "";
    TbPW.FontSize = 16;
    TbPW.FontWeight = FontWeights.ExtraBold;
    TbPW.Foreground = new SolidColorBrush(Colors.Black);
    TbPW.Background = new SolidColorBrush(Colors.Transparent);
    TbPW.VerticalAlignment = VerticalAlignment.Top;
    TbPW.Height = 70;
    TbPW.Tap += TbPW_Tap;
    //Show the background color of MyGrid
    MyGrid.Background = new SolidColorBrush(Colors.Blue);
    // Create Row for Username Textblock
    RowDefinition gridRow0 = new RowDefinition();
    gridRow0.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow0);
    // Create Row for Username
    RowDefinition gridRow1 = new RowDefinition();
    gridRow1.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow1);
    //create row for password Textblock
    RowDefinition gridRow2a = new RowDefinition();
    gridRow2a.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2a);
    //create row for password
    RowDefinition gridRow2 = new RowDefinition();
    gridRow2.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2);
    //create row for << Sign In >>
    RowDefinition gridRow3 = new RowDefinition();
    gridRow3.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow3);
    //create row for << Sign Up >>
    RowDefinition gridRow4 = new RowDefinition();
    gridRow4.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow4);
    Grid.SetRow(un, 0);
    Grid.SetColumn(un, 0);
    Grid.SetRow(TbUN, 1);
    Grid.SetColumn(TbUN, 0);
    Grid.SetRow(pw, 2);
    Grid.SetColumn(pw, 0);
    Grid.SetRow(TbPW, 3);
    Grid.SetColumn(TbPW, 0);
    Grid.SetRow(BtnSignIn, 4);
    Grid.SetColumn(BtnSignIn, 0);
    Grid.SetRow(BtnSignUp, 5);
    Grid.SetColumn(BtnSignUp, 0);
    MyGrid.Children.Add(un);
    MyGrid.Children.Add(TbUN);
    MyGrid.Children.Add(pw);
    MyGrid.Children.Add(TbPW);
    MyGrid.Children.Add(BtnSignIn);
    MyGrid.Children.Add(BtnSignUp);
    private void SignUp_Tab(object sender, RoutedEventArgs e)
    MessageBox.Show("Welcome to Sign up.\n\nYou need 3 things to create an account:\n1. A unique Case-Sensitive Username. ex 'iClips' is not the same as 'Iclips'\n2. A password to secure you account. \n3. A profile photo for easy recognition.\nThank you.");
    // remove all elements inside sign grid
    for (int index = MyGrid.Children.Count - 1; index >= 0; index--)
    MyGrid.Children.RemoveAt(index);
    //repopulate grid with Sign Up elements
    //create title
    title = new TextBlock();
    title.Text = "--- Sign Up 1/2 ---";
    title.VerticalAlignment = VerticalAlignment.Top;
    title.HorizontalAlignment = HorizontalAlignment.Center;
    //field for Username
    TbUN = new TextBox();
    TbUN.Opacity = 0.5;
    TbUN.Text = "Username";
    TbUN.FontSize = 16;
    TbUN.FontWeight = FontWeights.ExtraBold;
    TbUN.Foreground = new SolidColorBrush(Colors.Black);
    TbUN.Background = new SolidColorBrush(Colors.Transparent);
    TbUN.VerticalAlignment = VerticalAlignment.Top;
    TbUN.Height = 70;
    TbUN.Tap += TbUN_Tap;
    //field for Password
    TbPW = new TextBox();
    TbPW.Opacity = 0.5;
    TbPW.Text = "Password";
    TbPW.FontSize = 16;
    TbPW.FontWeight = FontWeights.ExtraBold;
    TbPW.Foreground = new SolidColorBrush(Colors.Black);
    TbPW.Background = new SolidColorBrush(Colors.Transparent);
    TbPW.VerticalAlignment = VerticalAlignment.Top;
    TbPW.Height = 70;
    TbPW.Tap += TbPW_Tap;
    //field Confirm for Password
    TbCPW = new TextBox();
    TbCPW.Opacity = 0.5;
    TbCPW.Text = "Confirm Password";
    TbCPW.FontSize = 16;
    TbCPW.FontWeight = FontWeights.ExtraBold;
    TbCPW.Foreground = new SolidColorBrush(Colors.Black);
    TbCPW.Background = new SolidColorBrush(Colors.Transparent);
    TbCPW.VerticalAlignment = VerticalAlignment.Top;
    TbCPW.Height = 70;
    TbCPW.Tap += TbCPW_Tap;
    //field for Optional Email
    TbEmail = new TextBox();
    TbEmail.Opacity = 0.5;
    TbEmail.Text = "Email (Optional)";
    TbEmail.FontSize = 16;
    TbEmail.FontWeight = FontWeights.ExtraBold;
    TbEmail.Foreground = new SolidColorBrush(Colors.Black);
    TbEmail.Background = new SolidColorBrush(Colors.Transparent);
    TbEmail.VerticalAlignment = VerticalAlignment.Top;
    TbEmail.Height = 70;
    TbEmail.Tap += TbEmail_Tap;
    HyperlinkButton BtnGoBack = new HyperlinkButton();
    BtnGoBack.Content = "<< Go Back ";
    BtnGoBack.Click += new RoutedEventHandler(BtnGoBack_Tab);
    BtnGoBack.VerticalAlignment = VerticalAlignment.Bottom;
    BtnSignUpSubmit = new HyperlinkButton();
    BtnSignUpSubmit.Content = "<< Sign Up >>";
    BtnSignUpSubmit.Click += new RoutedEventHandler(BtnSignUpSubmit_Tab);
    BtnSignUpSubmit.VerticalAlignment = VerticalAlignment.Bottom;
    // Create Row for title
    RowDefinition gridRow0 = new RowDefinition();
    gridRow0.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow0);
    // Create Row for Username
    RowDefinition gridRow1 = new RowDefinition();
    gridRow1.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow1);
    //create row for password Textblock
    RowDefinition gridRow2a = new RowDefinition();
    gridRow2a.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2a);
    //create row for Confirm password
    RowDefinition gridRow2 = new RowDefinition();
    gridRow2.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2);
    //create row for email
    RowDefinition gridRow3 = new RowDefinition();
    gridRow3.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow3);
    //create row for << Sign Up >>
    RowDefinition gridRow4 = new RowDefinition();
    gridRow4.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow4);
    //create row for << Go Back >>
    RowDefinition gridRow5 = new RowDefinition();
    gridRow5.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow5);
    Grid.SetRow(title, 0);
    Grid.SetColumn(title, 0);
    Grid.SetRow(TbUN, 1);
    Grid.SetColumn(TbUN, 0);
    Grid.SetRow(TbPW, 2);
    Grid.SetColumn(TbPW, 0);
    Grid.SetRow(TbCPW, 3);
    Grid.SetColumn(TbCPW, 0);
    Grid.SetRow(TbEmail, 4);
    Grid.SetColumn(TbEmail, 0);
    Grid.SetRow(BtnSignUpSubmit, 5);
    Grid.SetColumn(BtnSignUpSubmit, 0);
    Grid.SetRow(BtnGoBack, 6);
    Grid.SetColumn(BtnGoBack, 0);
    MyGrid.Children.Add(title);
    MyGrid.Children.Add(TbUN);
    MyGrid.Children.Add(TbPW);
    MyGrid.Children.Add(TbCPW);
    MyGrid.Children.Add(TbEmail);
    MyGrid.Children.Add(BtnSignUpSubmit);
    MyGrid.Children.Add(BtnGoBack);
    BtnSignUp.Content = "<< Sign Up >>";
    private bool IsUsernameValid(string str)
    int d;
    if (str.Length > 30)
    MessageBox.Show("You may only use a maximum of 30 characters for your Username.\nThank you.");
    return false;
    for (d = 0; d < str.Length; d++)
    if (str.Contains("~") || str.Contains("!") || str.Contains("@") || str.Contains("$")
    || str.Contains("#") || str.Contains("%") || str.Contains("|") || str.Contains("_"))
    MessageBox.Show("Your Username may not contain any of the follwing characters: \n~ ! @ # $ % | _\nThank you.");
    return false;
    return true;
    private void BtnSignUpSubmit_Tab(object sender, RoutedEventArgs e)
    //show error if Username == Username
    if (TbUN.Text.ToString() == "Username")
    MessageBox.Show("You must fill in your Username in the Username textbox.\nThank you.");
    return;
    //make sure all fields are filled in
    if (TbUN.Text.ToString() == "" || TbPW.Text.ToString() == "" || TbCPW.Text.ToString() == "")
    MessageBox.Show("All fields must be filled in.\nThank you.");
    return;
    //make sure Password is the same as Confirm Password
    if (TbPW.Text.CompareTo(TbCPW.Text) != 0)
    MessageBox.Show("Your Password should be the same as Confirm Password.\nThank you.");
    return;
    //make sure Username contains valid characters
    bool bValid = IsUsernameValid(TbUN.Text);
    if (bValid)
    bSignUp = true;
    //disable textboxes
    TbUN.IsEnabled = false;
    TbPW.IsEnabled = false;
    TbCPW.IsEnabled = false;
    TbEmail.IsEnabled = false;
    BtnSignUpSubmit.IsEnabled = false;
    title.Text = "requesting...";
    //make Post request top-server
    //add parameters
    string data = "username="+TbUN.Text+"&Password="+TbPW.Text;
    if(TbEmail.Text.Contains("@") && TbEmail.Text.Contains("."))
    data += "&email=" + TbEmail.Text;
    System.Uri URL = new Uri("http://www.iclips.co.za/RegisterUsernameAndPassword.php");
    WebRequest webRequest = WebRequest.Create(URL);
    webRequest.Method = "POST";
    webRequest.ContentType = "application/x-www-form-urlencoded";
    webRequest.ContentLength = data.Length;
    //we first obtain an input stream to which to write the body of the HTTP POST
    webRequest.BeginGetRequestStream((IAsyncResult result) =>
    HttpWebRequest preq = result.AsyncState as HttpWebRequest;
    if (preq != null)
    Stream postStream = preq.EndGetRequestStream(result);
    //guess one could just accept a byte[] [via function argument] for arbitrary data types - images, audio,...
    byte[] dataStream = Encoding.UTF8.GetBytes(data);
    postStream.Write(dataStream, 0, dataStream.Length);
    postStream.Close();
    //we can then finalize the request...
    preq.BeginGetResponse((IAsyncResult final_result) =>
    HttpWebRequest req = final_result.AsyncState as HttpWebRequest;
    if (req != null)
    try
    //we call the success callback as long as we get a response stream
    WebResponse response = req.EndGetResponse(final_result);
    success_callback(response.GetResponseStream());
    catch (WebException we)
    //otherwise call the error/failure callback
    error_callback(we.Message);
    return;
    }, preq);
    }, URL);
    private void error_callback(string p)
    if (bSignUp)
    bSignUp = false;
    // Show error message
    MessageBox.Show("Connection Error!\n\n" + p);
    //enable input
    //disable textboxes
    TbUN.IsEnabled = true;
    TbPW.IsEnabled = true;
    TbCPW.IsEnabled = true;
    TbEmail.IsEnabled = true;
    BtnSignUpSubmit.IsEnabled = false;
    title.Text = "try again";
    private void success_callback(Stream stream)
    if (bSignUp)
    bSignUp = false;
    // Open the stream using a StreamReader for easy access.
    StreamReader reader = new StreamReader(stream);
    // Read the content.
    string response = reader.ReadToEnd();
    // Display the content.
    MessageBox.Show(response);
    // Clean up the streams.
    reader.Close();
    private void BtnGoBack_Tab(object sender, RoutedEventArgs e)
    SignIn();
    private void TbEmail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbEmail.SelectAll();
    private void TbCPW_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbCPW.SelectAll();
    private void SignIn_Tab(object sender, RoutedEventArgs e)
    if (TbUN.Text.ToString() == "" || TbPW.Text.ToString() == "")
    MessageBox.Show("Your Username or Password cannot be empty.\nThank you.");
    return;
    private void TbUN_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbUN.SelectAll();
    un.Text = "Usernames are Case-Sensitive.\n'Iclips' is not the same as 'iClips'.";
    private void TbPW_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbPW.SelectAll();
    protected override void OnNavigatedTo(NavigationEventArgs e)
    base.OnNavigatedTo(e);
    // Initialize the video recorder.
    InitializeVideoRecorder();
    CameraButtons.ShutterKeyHalfPressed += OnButtonHalfPress;
    // The event is fired when the shutter button receives a full press.
    CameraButtons.ShutterKeyPressed += OnButtonFullPress;
    // The event is fired when the shutter button is released.
    CameraButtons.ShutterKeyReleased += OnButtonRelease;
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    // Dispose of camera and media objects.
    DisposeVideoPlayer();
    DisposeVideoRecorder();
    base.OnNavigatedFrom(e);
    CameraButtons.ShutterKeyHalfPressed -= OnButtonHalfPress;
    CameraButtons.ShutterKeyPressed -= OnButtonFullPress;
    CameraButtons.ShutterKeyReleased -= OnButtonRelease;
    // Ensure that the viewfinder is upright in LandscapeRight.
    protected override void OnOrientationChanged(OrientationChangedEventArgs e)
    if (vcDevice != null)
    if (e.Orientation == PageOrientation.LandscapeLeft)
    txtDebug.Text = "LandscapeLeft";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.PortraitUp)
    txtDebug.Text = "PortraitUp";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 0;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 0;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.LandscapeRight)
    txtDebug.Text = "LandscapeRight";
    // Rotate for LandscapeRight orientation.
    //videoRecorderBrush.RelativeTransform =
    //new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 180 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = -90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = -90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.PortraitDown)
    txtDebug.Text = "PortraitDown";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 270 };
    // Provide auto-focus with a half button press using the hardware shutter button.
    private void OnButtonHalfPress(object sender, EventArgs e)
    // Focus when a capture is not in progress.
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Half Button Press: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Capture the image with a full button press using the hardware shutter button.
    private void OnButtonFullPress(object sender, EventArgs e)
    // Focus when a capture is not in progress.
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Full Button Press: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Cancel the focus if the half button press is released using the hardware shutter button.
    private void OnButtonRelease(object sender, EventArgs e)
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Shutter is released: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Update the buttons and text on the UI thread based on app state.
    private void UpdateUI(ButtonState currentButtonState, string statusMessage)
    // Run code on the UI thread.
    Dispatcher.BeginInvoke(delegate
    switch (currentButtonState)
    // When the camera is not supported by the phone.
    case ButtonState.CameraNotSupported:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // First launch of the application, so no video is available.
    case ButtonState.Initialized:
    StartRecording.IsEnabled = true;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // Ready to record, so video is available for viewing.
    case ButtonState.Ready:
    StartRecording.IsEnabled = true;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = true;
    PausePlayback.IsEnabled = false;
    break;
    // Video recording is in progress.
    case ButtonState.Recording:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // Video playback is in progress.
    case ButtonState.Playback:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = true;
    break;
    // Video playback has been paused.
    case ButtonState.Paused:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = true;
    PausePlayback.IsEnabled = false;
    break;
    default:
    break;
    // Display a message.
    txtDebug.Text = statusMessage;
    // Note the current application state.
    currentAppState = currentButtonState;
    public void InitializeVideoRecorder()
    if (captureSource == null)
    // Create the VideoRecorder objects.
    captureSource = new CaptureSource();
    fileSink = new FileSink();
    vcDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
    // Add eventhandlers for captureSource.
    captureSource.CaptureFailed += new EventHandler<ExceptionRoutedEventArgs>(OnCaptureFailed);
    // Initialize the camera if it exists on the phone.
    if (vcDevice != null)
    // Create the VideoBrush for the viewfinder.
    videoRecorderBrush = new VideoBrush();
    videoRecorderBrush.SetSource(captureSource);
    // Display the viewfinder image on the rectangle.
    viewfinderRectangle.Fill = videoRecorderBrush;
    // Start video capture and display it on the viewfinder.
    captureSource.Start();
    // Set the button state and the message.
    UpdateUI(ButtonState.Initialized, "Tap record to start recording...");
    else
    // Disable buttons when the camera is not supported by the phone.
    UpdateUI(ButtonState.CameraNotSupported, "A camera is not supported on this phone.");
    // Set recording state: start recording.
    private void StartVideoRecording()
    try
    // Connect fileSink to captureSource.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Connect the input and output of fileSink.
    fileSink.CaptureSource = captureSource;
    fileSink.IsolatedStorageFileName = isoVideoFileName;
    // Begin recording.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Stopped)
    captureSource.Start();
    // Set the button states and the message.
    UpdateUI(ButtonState.Recording, "Recording...");
    StartTimer();
    // If recording fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    //start the timer
    private void StartTimer()
    dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
    dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
    dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
    dispatcherTimer.Start();
    startTime = System.DateTime.Now;
    private void StopTimer()
    dispatcherTimer.Stop();
    private void dispatcherTimer_Tick(object sender, EventArgs e)
    System.DateTime now = System.DateTime.Now;
    txtRecTime.Text = now.Subtract(startTime).ToString();
    // Set the recording state: stop recording.
    private void StopVideoRecording()
    try
    // Stop recording.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Disconnect fileSink.
    fileSink.CaptureSource = null;
    fileSink.IsolatedStorageFileName = null;
    // Set the button states and the message.
    UpdateUI(ButtonState.Stopped, "Preparing viewfinder...");
    StopTimer();
    StartVideoPreview();
    // If stop fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    // Set the recording state: display the video on the viewfinder.
    private void StartVideoPreview()
    try
    // Display the video on the viewfinder.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Stopped)
    // Add captureSource to videoBrush.
    videoRecorderBrush.SetSource(captureSource);
    // Add videoBrush to the visual tree.
    viewfinderRectangle.Fill = videoRecorderBrush;
    captureSource.Start();
    // Set the button states and the message.
    UpdateUI(ButtonState.Ready, "Ready to record.");
    // If preview fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    // Start the video recording.
    private void StartRecording_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StartRecording.IsEnabled = false;
    StartVideoRecording();
    // Handle stop requests.
    private void StopPlaybackRecording_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StopPlaybackRecording.IsEnabled = false;
    // Stop during video recording.
    if (currentAppState == ButtonState.Recording)
    StopVideoRecording();
    // Set the button state and the message.
    UpdateUI(ButtonState.NoChange, "Recording stopped.");
    // Stop during video playback.
    else
    // Remove playback objects.
    DisposeVideoPlayer();
    StartVideoPreview();
    // Set the button state and the message.
    UpdateUI(ButtonState.NoChange, "Playback stopped.");
    // Start video playback.
    private void StartPlayback_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StartPlayback.IsEnabled = false;
    // Start video playback when the file stream exists.
    if (isoVideoFile != null)
    VideoPlayer.Play();
    // Start the video for the first time.
    else
    // Stop the capture source.
    captureSource.Stop();
    // Remove VideoBrush from the tree.
    viewfinderRectangle.Fill = null;
    // Create the file stream and attach it to the MediaElement.
    isoVideoFile = new IsolatedStorageFileStream(isoVideoFileName,
    FileMode.Open, FileAccess.Read,
    IsolatedStorageFile.GetUserStoreForApplication());
    VideoPlayer.SetSource(isoVideoFile);
    // Add an event handler for the end of playback.
    VideoPlayer.MediaEnded += new RoutedEventHandler(VideoPlayerMediaEnded);
    // Start video playback.
    VideoPlayer.Play();
    // Set the button state and the message.
    UpdateUI(ButtonState.Playback, "Playback started.");
    // Pause video playback.
    private void PausePlayback_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    PausePlayback.IsEnabled = false;
    // If mediaElement exists, pause playback.
    if (VideoPlayer != null)
    VideoPlayer.Pause();
    // Set the button state and the message.
    UpdateUI(ButtonState.Paused, "Playback paused.");
    private void DisposeVideoPlayer()
    if (VideoPlayer != null)
    // Stop the VideoPlayer MediaElement.
    VideoPlayer.Stop();
    // Remove playback objects.
    VideoPlayer.Source = null;
    isoVideoFile = null;
    // Remove the event handler.
    VideoPlayer.MediaEnded -= VideoPlayerMediaEnded;
    private void DisposeVideoRecorder()
    if (captureSource != null)
    // Stop captureSource if it is running.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Remove the event handler for captureSource.
    captureSource.CaptureFailed -= OnCaptureFailed;
    // Remove the video recording objects.
    captureSource = null;
    vcDevice = null;
    fileSink = null;
    videoRecorderBrush = null;
    // If recording fails, display an error message.
    private void OnCaptureFailed(object sender, ExceptionRoutedEventArgs e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.ErrorException.Message.ToString();
    // Display the viewfinder when playback ends.
    public void VideoPlayerMediaEnded(object sender, RoutedEventArgs e)
    // Remove the playback objects.
    DisposeVideoPlayer();
    StartVideoPreview();
    public void SetScreenResolution()
    w = Application.Current.Host.Content.ActualWidth;
    h = Application.Current.Host.Content.ActualHeight;
    setResViewF(w, h);
    public void setResViewF(double width, double height)
    viewfinderRectangle.Width = width;
    viewfinderRectangle.Height = height;
    resMI.Content = "resolution: " + width + "*" + height;
    private void resMI_Click(object sender, RoutedEventArgs e)
    switch (resMI.Content.ToString())
    case "resolution: 176*220":
    setResViewF(240, 320);
    break;
    case "resolution: 240*320":
    setResViewF(360, 480);
    break;
    case "resolution: 360*480":
    setResViewF(480, 800);
    break;
    case "resolution: 480*800":
    setResViewF(1440, 720);
    break;
    case "resolution: 1440*720":
    setResViewF(1920, 1080);
    break;
    case "resolution: 1920*1080":
    setResViewF(176, 220);
    break;
    default:
    setResViewF(176, 220);
    break;
    public void WriteToFile(string key, string value)
    var Iso_settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
    if (!Iso_settings.Contains(key))
    Iso_settings.Add(key, value);
    Iso_settings.Save();//This will save your data in isolated storage.
    public string ReadFromFile(string key)
    var Iso_settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
    if (Iso_settings.Contains(key))
    return (string)Iso_settings[key];
    else
    return null;
    public DispatcherTimer dispatcherTimer { get; set; }
    private void ToggleZoom(MediaElement media)
    if (media.Stretch != Stretch.UniformToFill)
    // zoom
    media.Stretch = Stretch.UniformToFill;
    else
    // unzoom
    media.Stretch = Stretch.Uniform;
    BtnSignUpSubmit_Tab is the HyperLinkButton that would trigger the web request process. I need this code to work perfectly because a lot of people will use this. If you can simplify the http web request that already feels so good. Thank you. 

  • I was trying to use the Matlabscripting VI, but it says it is for instructional purpose and not for research and the system is getting stuck.When I used it two days back it worked.Could U plz tell me what the problem is??

    I have Labview 7.0 and Matlab 6.5 installed on all the computers at my School. When I tried to use the Matllab Scripting Window for the first time, it worked, but after two days when I was trying to run the program, there was a meesage saying that the License is for instructional Purpose only and not for Research or commercial use and the Labview is getting totally stuck. I need the Matlab Scripting VI for my Project,could anyone suggest what I shd do or is there any other method by which I could do that.

    Hello Medha,
    Thank you for contacting National Instruments.
    From the information you have provided, I am not sure what is causing your problem. Make sure that you do not have an evaluation license for LabVIEW.
    What, if anything, was changed in your VI before it stopped working? Will it run without the Matlab script?
    If you continue having trouble getting your VI to work, please respond with more information. If you like, you can post your VI (along with any necessary sub-VIs) and I will take a look at it.
    Have a great day,
    Sean C.
    Applications Engineer
    National Instruments

  • CS2- How to get the fonts used in a document ?

    Hi,
    Can anyone tell how to find the the fonts used in the document directly without iterating through the text art used in the document.BCOZ if i iterate through each text frame or character my plugin works very slowly.I want to speed up the process of finding & replacing the fonts like wat we do manually in the "Type-> Find Font" menu thru my code.
    Please post ur comments on this .If there is no direct option to find &replace the fonts used in the document ,pls let me know the simplest logic of finding & replacing all occurances of a font in a doc so that my process of doing this should be faster.
    Thanks in advance.
    myRiaz

    As far as I know, there's no way to get a list of fonts in use in a document without iterating over the document and compiling a list by asking every piece of art.
    If you want to trigger 'Type > Find Font' there might be a way to invoke that using Actions (AIActionManager.h). I'm not sure if that would help or not though.
    This probably isn't very helpful depending on what you're doing, but I think this is meant to be handled by using character styles. That way you can change a style and update any related text instantly. Not much help though if you're just trying to write a S&R font plugin.

  • My macbook works well while connected to the charger, but using the battery it gets really slow

    My macbook pro 2011 yosemite 10.10.1, (2,3 GHz Intel Core i5 / 4 GB 1333 MHz DDR3 / Intel HD Graphics 3000 384 MB) recently started to present a problem that when using only the battery, it gets really slow, but connected to the charger, it operates normally. I have already taken to a technical assistance but was not presented any problem in the battery. And when I open activity monitor it shows that the kernel_task process uses almost 100% CPU and so is almost 0% idle, so it is almost impossible to use the computer (using the battery). Is there anything I can do to prevent this process using 100% CPU?

    My recommendation for a SMC reset was initiated by your posts indication poor performance when under battery power.  Often a SMC reset will correct bad battery behavior but apparently not in your case.
    Look at this article and see if there are any possible hints for correction of the problem:
    http://www.cnet.com/news/kerneltask-process-taking-up-an-inordinate-amount-of-cp u/
    If not, the the best option will be an Apple store genius bar appointment.
    Ciao.

  • Need help to retrieve the message from MQ using get operation

    Hi
    Used MQ adapter to Post a message to queue.
    And used Received activity in bpel to retrieve the message using MQ adapter from same queue(used get operation) , got an error message as timed
    out exception.
    Could some one assist in retrieving the message from MQ using get operation.
    Regards
    Raja

    Hi Raja,
    Is the process a empty bpel process which is used to get the message from the MQ?
    Regards
    Surya

Maybe you are looking for

  • Writing new lines or carrige returns to a text file

    I am try to use either FileOutputStream or FileWriter to write a String to a text file. Only any \n or \r characters within the string open as square blocks in notepad when the string is writen, and all the text is on one line. example code: FileWrit

  • New To Java. Learning About Java Applet.

    Hi all, i am new to java. Actually i am facing problem with java applet. I am trying to use my cellphone to surf web. When i open a webpage from cellphone, the part which contain the java applet, it cannot be shown and appeared blank. I am using Noki

  • Keywords imported from PSE 5.0 (Poor User Experience)

    When moving to Lightroom, I successfully imported my substantial catalog (6,000 images) from Photoshop Elements 5.0. Keyword importing doesn't seem to be quite right, however. I've noticed the following two problems. 1. All keywords appear both in th

  • Insufficient Priviliages on Apple Mobile Devices to install itunes

    I try to install itunes on my brand new computer but so far it has given me error 7 and said it fails to install Apple mobile devices because insufficient privilages. Can someone tell me what i can do to fix this? Cheers

  • Help - probz with starting up after re-installin O/S 9.2??

    Hi, I inherited a powermac G3 from a friend who advised a reinstall of OS9 due to passwords, users etc... so I've done that and now I can't get the mac to boot up properly. It boots up fine with the OS disc in the drive - but obviously I can't leave