|
If I was one of the poor sods on the course, that would annoy the hell out of me, particularly if I was paying with my own money:
1) Start training video
2) Wait a few minutes while we copy the file over the network.
3) Video starts.
Copy them all to local HDD: no delay, no stutter, no problem. You can then control it in MediaPlayer (or whatever) via sockets so the trainee does not need to go anywhere near the video file itself.
If the tutor is that paraniod, he can copy them ready in preparation for the days lesson.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Didn't say it wouldn't be annoying
I guess it depends on how large the files are.
But even in your scenario the logic still holds, minus the copy part. And provided the tutor put the files all in the same location (something like c:\videos).
I guess the best option here would be:
Go buy a projector
|
|
|
|
|
Tom Deketelaere wrote: Go buy a projector
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
buy a projector............
help me out its a wonderfull challenge to do
|
|
|
|
|
Tom Deketelaere wrote: Go buy a projector
Damn, thats what I was gonna say.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I have found a good article at http://www.codeguru.com/columns/vb/article.php/c8459__2/ to build a ftp client. But I wanted to get everyone's input on what the best way of doing this in c#.net or vb.net 2008.
What I am wanting to do is have 2 simple classes:
Class 1: Upload...
Class 2: Download...
All I want to pass into the class is the following:
IP Address
Port
Login
Password
Sending/Receiving File Location.
However I need the 2 classes to generate a form to show the user the stages of connection and progression of transmission.
Anyone have any insights on how I can go about this. Perhaps websites that can give me a working model to build from.
I could simply pass the command thru the command prompt but I would rather it be part of the main application and or .net framework if possible.
|
|
|
|
|
|
i want to get noticed that some mail have been recieved in my outlook n if it is from a desired sender then i want my code to code some task...i want to do it in C#....can n e budy will help me.....thanx.
|
|
|
|
|
What have you tried ? What have you found out ? Have you installed the Microsoft tools for office ? What do the docs say you can and cannot do ? I doubt you can get a message from outlook, I expect you'd have to poll it at regular intervals.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Gotcha again - this person asked the same question 3 days ago and got some good references, where is that bloody pop up......
|
|
|
|
|
consentrate buddy....i have asked earlier about sending the mail to outlook inbox of anybuddy....now i have the exactly opposite question....that is how do i get informed that some mail have arrived in my outlook inbox!!!! make it clear!!!!
|
|
|
|
|
Hi,
I host a WebBrowser control in a WinForm. When the user clicks a button I call Navigate(url) on the control, but it's not 100% reliable. Sometimes the control will navigate to the page, but sometimes it won't, for exactly the same URL. Has anyone seen something similar?
thanx
|
|
|
|
|
I would imagine this means that there's events being fired by the control and sometimes you're in sync with them, and some times not. You should look at what state change events the control fires and see if you can detect a pattern between those and when your code works or not. The control should work just fine.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'm not sure what you mean. I call webControl1.Navigate("www.amazon.com"); on every button click. Sometimes it works, sometimes it doesn't.
|
|
|
|
|
Well, the control works, so one assumes that it must sometimes be in a state where you have to wait before you navigate.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi
I have a method that takes in data from XML, puts it temporarily into a dataset, where I then add to a List Object. This bits ok, but where I am falling over, is where there is more than one item of data in an XML node. In my code I am using foreach to iterate through each node, and this is working because I am seeing loop through each element in the node. However, when I am adding it to the List Object, it is only adding the last node to the list rather than every element.
The structure of the xml is that the first two nodes can only have one set of data, but the last two can have one to many, and this is where it goes wrong. I did try mylist.add(adddata) at the end of the loop, but what happened was that the last item was added but repeated x number of times for the number of items in the data.
Can anyone show me a good answer to this problem?
Thanks
|
|
|
|
|
It's impossible to say what's wrong without seeing the code that is doing this processing.
|
|
|
|
|
Hi
I know this sounds an odd question, but there is logic to my question. In my application, there will be a method that will call a method in a web service. However, and this is the logic bit, I just don't want to call the method and hope for the best, I want to check to see if the web service is running first. If it is, then call the method, else return a message to the user to say it is not running.
Does anyone show me a neat way to check to see if a web service is running or not?
Thanks
|
|
|
|
|
The only way to tell is to call it. Simple as that. There is no cool little trick to find out.
|
|
|
|
|
If you wrote the web service you could add an IsRunning method...
But your best bet is to just call the desired method.
|
|
|
|
|
PIEBALDconsult wrote: If you wrote the web service you could add an IsRunning method...
Which would timeout just like calling the original method anyway. So what's the difference? Adding a second webservice that would tell you the status of the first one, which it could only do by calling it itself... ...and so on, and such like...
|
|
|
|
|
|
I'm trying to learn and work on azure table storage. The code works perfectly in my local. When I configure to the azure and still trying to work with my local (not using publish), I'm getting an exception.
public bool DoesTableExist(string tableName)
{
ParameterValidator.CheckStringParameter(tableName, false, "tableName");
bool tableExists = false;
RetryPolicy(() =>
{
try
{
DataServiceContext svc = GetDataServiceContext();
svc.MergeOption = MergeOption.NoTracking;
IEnumerable<TableStorageTable> query = from t in svc.CreateQuery<TableStorageTable>(TableStorageConstants.TablesName)
where t.TableName == tableName
select t;
tableExists = false;
try
{
// the query contains the whole primary key
// thus, if the query succeeds we can be sure that the table exists
(query as DataServiceQuery<tablestoragetable>).Execute(); tableExists = true;
}
catch (DataServiceQueryException e)
{
HttpStatusCode s;
if (TableStorageHelpers.EvaluateException(e, out s) && s == HttpStatusCode.NotFound)
{
tableExists = false;
}
else
{
throw;
}
}
catch (NullReferenceException ne)
{
//This is a workaround for bug in DataServiceQuery<T>.Execute. It throws a
//NullReferenceException instead of a DataServiceRequestException when it
//cannot connect to the the server. This workaround will be removed when
//the fix for this bug is released.
throw new DataServiceRequestException("Unable to connect to server.", ne);
}
}
catch (InvalidOperationException e)
{
HttpStatusCode status;
if (TableStorageHelpers.CanBeRetried(e, out status))
{
throw new TableRetryWrapperException(e);
}
throw;
}
});
return tableExists;
}
when it executes the (query as DataServiceQuery<TableStorageTable>).Execute() it has to fail and come to DataServiceQueryException and make tableExists = false and return with the same to create the table. Instead the code goes to the catch (NullReferenceException ne)and says unable to connect to the server. can someone help me onthis please.Thanks.
|
|
|
|
|
Hello Everyone, Im an extremely new programmer and this is the first time im trying out something like this.
I need to upload a XSD file and a XML file, then I need to check whether the XML file is valid comparing to the XSD file. These files are on my desktop.
Here is my code so far, but I am missing a lot of things. Any help will be great.
Button1: This is my validate Button
Button 2: This is my XML upload Button
Button 3: This is my XSD validate Button
inputtext: This is my textbox where the xml file location
inputtext2: This is my textbox where the xsd file location
textbox1: this is my output button.
One of the main things im having trouble with is that once my file link shows up to the inputtext, I dont know how to run the validation check on it with the xsd file. I know my code doesnt have any link with the xml and xsd files...its becasue I dont know how to link them. You may assume file names to be sample.xml and sample.xsd. Thanks
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.IO;
using System.Xml;
using System.Xml.Schema;
namespace ValidateXML
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string strXML; //- In put XML file
string strXSD; //- In put XSD file
string strXSDNS;
void ValidateXML(string strXML, string strXSD, string strXSDNS)
{
//Create a XmlValidatingReader, XmlSchemaCollection and ValidationEventHandler objects to be used to validate the XML against an XSD file
XmlValidatingReader reader = null;
XmlSchemaCollection myschema = new XmlSchemaCollection();
ValidationEventHandler eventHandler = new ValidationEventHandler(ShowCompileErrors);
try
{
//Create the XML fragment to be parsed.
XmlDocument doc = new XmlDocument();
doc.Load(strXML);
string xmlFrag = doc.InnerXml;
//Create an XmlParserContext object for use with the XMLValidatingReader:
/////String xmlFrag = "<author xmlns='urn:bookstore-schema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" +
// "<first-name>Herman</first-name>" +
// "<last-name>Melville</last-name>" +
//"</author>";
//Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, null, "", XmlSpace.None);
//Implement the reader.
reader = new XmlValidatingReader(xmlFrag, XmlNodeType.Element, context);
// Add the relevant schema files (.XSD) to the name space we are checking
//against and repeat until all the schema's have an associated XSD file with them.
//Add the schema.
myschema.Add(strXSD, strXSD);
//Set the schema type and add the schema to the reader.
reader.ValidationType = ValidationType.Schema;
reader.Schemas.Add(myschema);
// Read in the XML Data:
while (reader.Read())
{
}
//If there is no exception, display "Completed Validating" or return a value indicating success
textBox1.Text = "Completed validating " + strXML;
}
//Watch out for exceptions within the XML file and display them appropriately to the user:
catch (XmlException XmlExp)
{
textBox1.Text = "XMLException " + XmlExp.Message;
}
//XMLSchemaExceptions are thrown when the XML document does not match the schema provided.
catch (XmlSchemaException XmlSchExp)
{
textBox1.Text = "XMLSchemaException " + XmlSchExp.Message;
}
//Catch all other exceptions and report them to the user:
catch (Exception GenExp)
{
textBox1.Text = "Exception " + GenExp.Message;
}
}
private void button1_Click(object sender, EventArgs e)
{
if (inputtext.Text == String.Empty)
{
textBox1.Text = ("Warning: Upload a XML file");
}
else if (inputtext2.Text == String.Empty)
{
textBox1.Text = ("Warning: Upload a XSD File");
}
else
{
ValidateXML(strXML, strXSD, "urn:bookstore-schema");
}
}
private void button2_Click(object sender, EventArgs e)
{
// Create an OpenFileDialog object.
OpenFileDialog openFile1 = new OpenFileDialog();
// Initialize the OpenFileDialog to look for text files.
openFile1.Filter = "(*.xml)|*.xml";
if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
inputtext.Text = openFile1.FileName;
}
}
private void button3_Click(object sender, EventArgs e)
{
OpenFileDialog openFile1 = new OpenFileDialog();
openFile1.Filter = "(*.xsd)|*.xsd";
if (openFile1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
inputtext2.Text = openFile1.FileName;
}
}
}
Thanks in advance for anyone that has helped me.
|
|
|
|
|
This is not an answer to your question, mainly because I have too much difficulty in reading your code, to be able to spot any problems. If you enclose your code in <pre>your code</pre> tags it will be much, much easier to read. The PRE tags maintain the formatting and colourize the code.
You state that
waqasm wrote: Im an extremely new programmer ,
so you have not yet had some bad habits ingrained. Before it becomes too late, each time that you add a Control to a Form give it a name that reflects what it does, e.g. validationButton instead of leaving it as button1 , do this immediately after adding it, before you do anything else like writing a click handler. That way, in six months time, when you look at your code again, you will not be forever thinking, "now what on earth did button1 or textBox1 do?" Some people put the control type first - validationButton would be buttonValidation for them. I use a similar scheme to that except I have, over the years, evolved a set of abbreviations for the controls - 'btn' for a Button, 'txt' for a TextBox, 'lbl' for a Label, 'cbox' for a ComboBox, 'lbox' for a ListBox and so on, so for me it would be btnValidation . Devise whatever you feel comfortable with, but please, please don't just leave them as button1 , button2 and so on.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|