Ejemplo n.º 1
0
        private void SendFileToServer(string filename)
        {
            byte[]     buffer = new byte[0x2004];
            FileStream stream = null;
            long       num    = 0L;

            try {
                int num2;
                stream = new FileStream(filename, FileMode.Open);
                for (num = stream.Length; num > 0L; num -= num2)
                {
                    num2 = stream.Read(buffer, 4, (num > 0x2000L) ? ((int)0x2000L) : ((int)num));
                    this.stream.SendEntirePacketDirectly(buffer, num2);
                }
                this.stream.SendEntirePacketDirectly(buffer, 0);
            } catch (Exception exception) {
                throw new MySqlException("Error during LOAD DATA LOCAL INFILE", exception);
            } finally {
                stream.Close();
            }
        }
Ejemplo n.º 2
0
		private void SendFileToServer(string filename) {
			byte[] buffer = new byte[0x2004];
			FileStream stream = null;
			long num = 0L;
			try {
				int num2;
				stream = new FileStream(filename, FileMode.Open);
				for (num = stream.Length; num > 0L; num -= num2) {
					num2 = stream.Read(buffer, 4, (num > 0x2000L) ? ((int)0x2000L) : ((int)num));
					this.stream.SendEntirePacketDirectly(buffer, num2);
				}
				this.stream.SendEntirePacketDirectly(buffer, 0);
			} catch (Exception exception) {
				throw new MySqlException("Error during LOAD DATA LOCAL INFILE", exception);
			} finally {
				stream.Close();
			}
		}