private void btnConnect_Click(object sender, System.EventArgs e) { if (m_bConnected) { // disconnect listView1.Clear(); m_jglue = null; btnConnect.Text = "Connect"; btnUpload.Enabled = false; btnImportFile.Enabled = false; statusBar1.Panels[0].Text = "Ready..."; } else { if (m_jglue != null) m_jglue = null; if (txtServerName.Text != "") { btnConnect.Text = "Disconnect"; m_jglue = new JglueService(txtServerName.Text); NameValue[] credentials = new NameValue[0]; m_sSessionId = m_jglue.login(credentials); if (m_sSessionId == "") { System.Windows.Forms.MessageBox.Show(this,"Could not get session id from server. Login command failed."); statusBar1.Panels[0].Text = "Error connecting..."; } else { m_bConnected = true; statusBar1.Panels[0].Text = "Connected, listing assets..."; Application.DoEvents(); RefreshAssetList(); statusBar1.Panels[0].Text = "List assets complete."; statusBar1.Panels[0].Text = "Making ftp connection..."; FtpSession = null; FtpSession = new KCommon.Net.FTP.Session(); FtpSession.Port = 2121; FtpSession.Server = txtServerName.Text; FtpSession.Connect("oyster","oyster"); FtpSession.CommandSent += new KCommon.Net.FTP.FtpCommandEventHandler(FtpSession_CommandSent); FtpSession.BeginPutFile += new KCommon.Net.FTP.FtpFileEventHandler(FtpSession_BeginPutFile); FtpSession.EndPutFile += new KCommon.Net.FTP.FtpFileEventHandler(FtpSession_EndPutFile); FtpSession.FileTransferProgress += new KCommon.Net.FTP.FtpFileEventHandler(FtpSession_FileTransferProgress); FtpSession.ResponseReceived += new KCommon.Net.FTP.FtpResponseEventHandler(FtpSession_ResponseReceived); FtpSession.BeginGetFile += new KCommon.Net.FTP.FtpFileEventHandler(FtpSession_BeginGetFile); FtpSession.EndGetFile += new KCommon.Net.FTP.FtpFileEventHandler(FtpSession_EndGetFile); // foreach (KCommon.Net.FTP.FtpDirectory dir in FtpSession.CurrentDirectory.SubDirectories) // { // if (dir.Name == "Oyster") // { // goto Oyster_Found; // } // } // Oyster_Found: statusBar1.Panels[0].Text = "Online. Ready."; btnUpload.Enabled = true; btnImportFile.Enabled = true; } } } }
private void frmImportFile_Load(object sender, System.EventArgs e) { m_Parent = (frmMain)this.Owner; m_jglue = m_Parent.m_jglue; m_sSession = m_Parent.m_sSessionId; string[] sAssets = m_jglue.listAssetGroups(m_sSession); foreach (string ss in sAssets) { cboAssetGroups.Items.Add(ss); } ttPath = new System.Windows.Forms.ToolTip(); ttPath.SetToolTip(txtPathToFile,"The path and name of the source, if it’s a local file, " + "or the FTP URL, if it’s located on a remote server. The FTP URL must be in the form " + "“ftp://username:password@serverName/path-to-file”"); int iEnc; iEnc = cboEncodingType.Items.Add("VideoServer.Option.MPEG1"); //cboEncodingType.Items.[iEnc].Tag = "VideoServer.Option.MPEG1"; iEnc = cboEncodingType.Items.Add("VideoServer.Option.MPEG1_Audio"); //cboEncodingType.Items[iEnc].Tag = "VideoServer.Option.MPEG1_Audio"; iEnc = cboEncodingType.Items.Add("VideoServer.Option.MPEG2"); //cboEncodingType.Items[iEnc].Tag = "VideoServer.Option.MPEG2"; iEnc = cboEncodingType.Items.Add("VideoServer.Option.MPEG4"); //cboEncodingType.Items[iEnc].Tag = "VideoServer.Option.MPEG4"; }
private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e) { m_jglue = null; }