| missing stuff when opening msp2003 file in msp2002 |
|
 |
Index ‹ DotNet ‹ Microsoft Project
|
- Previous
- 1
- 2
- Visual C#.Net >> Unable to write data to the transport connection: An established connectionHello,
I'm trying to upload a file programatically and occasionally I get the
following error message.
Unable to write data to the transport connection: An established connection
was aborted by the software in your host machine.
Stack Trace
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32
size)
at System.Net.FtpDataStream.Write(Byte[] buffer, Int32 offset, Int32
size)
at HSMoveFiles.FTPClient.Upload(FileInfo fi, String targetFilename) in
C:\DOTNET\HSMoveFiles\FTPClient.cs:line 177
The source code for FTPClient.cs came from the following URL
http://www.codeproject.com/vb/net/FtpClient.asp
The exception is been thrown when trying to write the Stream.
rs.Write(content, 0, dataRead)
Has anyone got any Idea why this might happen and how to solve it?
Exception is caught at line number 185. Throw ex;.
Here is the source code. See line number 177.
using System.Collections.Generic;
using System;
using System.Net;
using System.IO;
using System.Runtime.Remoting.Lifetime;
using System.Text.RegularExpressions;
namespace HSMoveFiles
{
#region "FTP client class"
/// <summary>
/// A wrapper class for .NET 2.0 FTP
/// </summary>
/// <remarks>
/// This class does not hold open an FTP connection but
/// instead is stateless: for each FTP request it
/// connects, performs the request and disconnects.
/// </remarks>
public class FTPClient
{
#region "CONSTRUCTORS"
/// <summary>
/// Blank constructor
/// </summary>
/// <remarks>Hostname, username and password must be set manually</remarks>
public FTPClient()
{
}
/// <summary>
/// Constructor just taking the hostname
/// </summary>
/// <param name="Hostname">in either ftp://ftp.host.com or ftp.host.com
form</param>
/// <remarks></remarks>
public FTPClient(string Hostname)
{
_hostname = Hostname;
}
/// <summary>
/// Constructor taking hostname, username and password
/// </summary>
/// <param name="Hostname">in either ftp://ftp.host.com or ftp.host.com
form</param>
/// <param name="Username">Leave blank to use 'anonymous' but set password
to your email</param>
/// <param name="Password"></param>
/// <remarks></remarks>
public FTPClient(string Hostname, string Username, string Password)
{
_hostname = Hostname;
_username = Username;
_password = Password;
}
#endregion
#region "Directory functions"
/// <summary>
/// Return a simple directory listing
/// </summary>
/// <param name="directory">Directory to list, e.g. /pub</param>
/// <returns>A list of filenames and directories as a List(of
String)</returns>
/// <remarks>For a detailed directory listing, use
ListDirectoryDetail</remarks>
public List<string> ListDirectory(string directory)
{
//return a simple list of filenames in directory
System.Net.FtpWebRequest ftp = GetRequest(GetDirectory(directory));
//Set request to do simple list
ftp.Method = System.Net.WebRequestMethods.Ftp.ListDirectory;
string str = GetStringResponse(ftp);
//replace CRLF to CR, remove last instance
str = str.Replace("\r\n", "\r").TrimEnd('\r');
//split the string into a list
List<string> result = new List<string>();
result.AddRange(str.Split('\r'));
return result;
}
/// <summary>
/// Return a detailed directory listing
/// </summary>
/// <param name="directory">Directory to list, e.g. /pub/etc</param>
/// <returns>An FTPDirectory object</returns>
public FTPdirectory ListDirectoryDetail(string directory)
{
System.Net.FtpWebRequest ftp = GetRequest(GetDirectory(directory));
//Set request to do simple list
ftp.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails;
string str = GetStringResponse(ftp);
//replace CRLF to CR, remove last instance
str = str.Replace("\r\n", "\r").TrimEnd('\r');
//split the string into a list
return new FTPdirectory(str, _lastDirectory);
}
#endregion
#region "Upload: File transfer TO ftp server"
/// <summary>
/// Copy a local file to the FTP server
/// </summary>
/// <param name="localFilename">Full path of the local file</param>
/// <param name="targetFilename">Target filename, if required</param>
/// <returns></returns>
/// <remarks>If the target filename is blank, the source filename is used
/// (assumes current directory). Otherwise use a filename to specify a name
/// or a full path and filename if required.</remarks>
public bool Upload(string localFilename, string targetFilename)
{
//1. check source
if (!File.Exists(localFilename))
{
throw (new ApplicationException("File " + localFilename + " not found"));
}
//copy to FI
FileInfo fi = new FileInfo(localFilename);
return Upload(fi, targetFilename);
}
/// <summary>
/// Upload a local file to the FTP server
/// </summary>
/// <param name="fi">Source file</param>
/// <param name="targetFilename">Target filename (optional)</param>
/// <returns></returns>
public bool Upload(FileInfo fi, string targetFilename)
{
//copy the file specified to target file: target file can be full path or
just filename (uses current dir)
//1. check target
string target;
if (targetFilename.Trim() == "")
{
//Blank target: use source filename & current dir
target = this.CurrentDirectory + fi.Name;
}
else if (targetFilename.Contains("/"))
{
//If contains / treat as a full path
target = AdjustDir(targetFilename);
}
else
{
//otherwise treat as filename only, use current directory
target = CurrentDirectory + targetFilename;
}
string URI = Hostname + target;
//perform copy
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to upload a file in binary
ftp.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
ftp.UseBinary = true;
//Notify FTP of the expected size
ftp.ContentLength = fi.Length;
//create byte array to store: ensure at least 1 byte!
int BufferSize = 2048;
byte[] content = new byte[BufferSize - 1 + 1];
int dataRead;
//open file for reading
using (FileStream fs = fi.OpenRead())
{
try
{
//open request to send
using (Stream rs = ftp.GetRequestStream())
{
do
{
dataRead = fs.Read(content, 0, BufferSize);
rs.Write(content, 0, dataRead);
} while (!(dataRead < BufferSize));
rs.Close();
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
//ensure file closed
fs.Close();
ftp = null;
}
}
return true;
}
#endregion
#region "Download: File transfer FROM ftp server"
/// <summary>
/// Copy a file from FTP server to local
/// </summary>
/// <param name="sourceFilename">Target filename, if required</param>
/// <param name="localFilename">Full path of the local file</param>
/// <returns></returns>
/// <remarks>Target can be blank (use same filename), or just a filename
/// (assumes current directory) or a full path and filename</remarks>
public bool Download(string sourceFilename, string localFilename, bool
PermitOverwrite)
{
//2. determine target file
FileInfo fi = new FileInfo(localFilename);
return this.Download(sourceFilename, fi, PermitOverwrite);
}
//Version taking an FtpFileInfo
public bool Download(FTPfileInfo file, string localFilename, bool
PermitOverwrite)
{
return this.Download(file.FullName, localFilename, PermitOverwrite);
}
//Another version taking FtpFileInfo and FileInfo
public bool Download(FTPfileInfo file, FileInfo localFI, bool
PermitOverwrite)
{
return this.Download(file.FullName, localFI, PermitOverwrite);
}
//Version taking string/FileInfo
public bool Download(string sourceFilename, FileInfo targetFI, bool
PermitOverwrite)
{
//1. check target
if (targetFI.Exists && !(PermitOverwrite))
{
throw (new ApplicationException("Target file already exists"));
}
//2. check source
string target;
if (sourceFilename.Trim() == "")
{
throw (new ApplicationException("File not specified"));
}
else if (sourceFilename.Contains("/"))
{
//treat as a full path
target = AdjustDir(sourceFilename);
}
else
{
//treat as filename only, use current directory
target = CurrentDirectory + sourceFilename;
}
string URI = Hostname + target;
//3. perform copy
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to download a file in binary mode
ftp.Method = System.Net.WebRequestMethods.Ftp.DownloadFile;
ftp.UseBinary = true;
//open request and get response stream
using (FtpWebResponse response = (FtpWebResponse)ftp.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
//loop to read & write to file
using (FileStream fs = targetFI.OpenWrite())
{
try
{
byte[] buffer = new byte[2048];
int read = 0;
do
{
read = responseStream.Read(buffer, 0, buffer.Length);
fs.Write(buffer, 0, read);
} while (!(read == 0));
responseStream.Close();
fs.Flush();
fs.Close();
}
catch (Exception)
{
//catch error and delete file only partially downloaded
fs.Close();
//delete target file as it's incomplete
targetFI.Delete();
throw;
}
}
responseStream.Close();
}
response.Close();
}
return true;
}
#endregion
#region "Other functions: Delete rename etc."
/// <summary>
/// Delete remote file
/// </summary>
/// <param name="filename">filename or full path</param>
/// <returns></returns>
/// <remarks></remarks>
public bool FtpDelete(string filename)
{
//Determine if file or full path
string URI = this.Hostname + GetFullPath(filename);
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to delete
ftp.Method = System.Net.WebRequestMethods.Ftp.DeleteFile;
try
{
//get response but ignore it
string str = GetStringResponse(ftp);
}
catch (Exception)
{
return false;
}
return true;
}
/// <summary>
/// Determine if file exists on remote FTP site
/// </summary>
/// <param name="filename">Filename (for current dir) or full path</param>
/// <returns></returns>
/// <remarks>Note this only works for files</remarks>
public bool FtpFileExists(string filename)
{
//Try to obtain filesize: if we get error msg containing "550"
//the file does not exist
try
{
long size = GetFileSize(filename);
return true;
}
catch (Exception ex)
{
//only handle expected not-found exception
if (ex is System.Net.WebException)
{
//file does not exist/no rights error = 550
if (ex.Message.Contains("550"))
{
//clear
return false;
}
else
{
throw;
}
}
else
{
throw;
}
}
}
/// <summary>
/// Determine size of remote file
/// </summary>
/// <param name="filename"></param>
/// <returns></returns>
/// <remarks>Throws an exception if file does not exist</remarks>
public long GetFileSize(string filename)
{
string path;
if (filename.Contains("/"))
{
path = AdjustDir(filename);
}
else
{
path = this.CurrentDirectory + filename;
}
string URI = this.Hostname + path;
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Try to get info on file/dir?
ftp.Method = System.Net.WebRequestMethods.Ftp.GetFileSize;
string tmp = this.GetStringResponse(ftp);
return GetSize(ftp);
}
public bool FtpRename(string sourceFilename, string newName)
{
//Does file exist?
string source = GetFullPath(sourceFilename);
if (!FtpFileExists(source))
{
throw (new FileNotFoundException("File " + source + " not found"));
}
//build target name, ensure it does not exist
string target = GetFullPath(newName);
if (target == source)
{
throw (new ApplicationException("Source and target are the same"));
}
else if (FtpFileExists(target))
{
throw (new ApplicationException("Target file " + target + " already
exists"));
}
//perform rename
string URI = this.Hostname + source;
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to delete
ftp.Method = System.Net.WebRequestMethods.Ftp.Rename;
ftp.RenameTo = target;
try
{
//get response but ignore it
string str = GetStringResponse(ftp);
}
catch (Exception)
{
return false;
}
return true;
}
public bool FtpCreateDirectory(string dirpath)
{
//perform create
string URI = this.Hostname + AdjustDir(dirpath);
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to MkDir
ftp.Method = System.Net.WebRequestMethods.Ftp.MakeDirectory;
try
{
//get response but ignore it
string str = GetStringResponse(ftp);
}
catch (Exception)
{
return false;
}
return true;
}
public bool FtpDeleteDirectory(string dirpath)
{
//perform remove
string URI = this.Hostname + AdjustDir(dirpath);
System.Net.FtpWebRequest ftp = GetRequest(URI);
//Set request to RmDir
ftp.Method = System.Net.WebRequestMethods.Ftp.RemoveDirectory;
try
{
//get response but ignore it
string str = GetStringResponse(ftp);
}
catch (Exception)
{
return false;
}
return true;
}
#endregion
#region "private supporting fns"
//Get the basic FtpWebRequest object with the
//common settings and security
private FtpWebRequest GetRequest(string URI)
{
//create request
FtpWebRequest result = (FtpWebRequest)FtpWebRequest.Create(URI);
//Set the login details
result.Credentials = GetCredentials();
//Do not keep alive (stateless mode)
result.KeepAlive = true;
return result;
}
/// <summary>
/// Get the credentials from username/password
/// </summary>
private System.Net.ICredentials GetCredentials()
{
return new System.Net.NetworkCredential(Username, Password);
}
/// <summary>
/// returns a full path using CurrentDirectory for a relative file reference
/// </summary>
private string GetFullPath(string file)
{
if (file.Contains("/"))
{
return AdjustDir(file);
}
else
{
return this.CurrentDirectory + file;
}
}
/// <summary>
/// Amend an FTP path so that it always starts with /
/// </summary>
/// <param name="path">Path to adjust</param>
/// <returns></returns>
/// <remarks></remarks>
private string AdjustDir(string path)
{
return ((path.StartsWith("/")) ? "" : "/").ToString() + path;
}
private string GetDirectory(string directory)
{
string URI;
if (directory == "")
{
//build from current
URI = Hostname + this.CurrentDirectory;
_lastDirectory = this.CurrentDirectory;
}
else
{
if (!directory.StartsWith("/"))
{
throw (new ApplicationException("Directory should start with /"));
}
URI = this.Hostname + directory;
_lastDirectory = directory;
}
return URI;
}
//stores last retrieved/set directory
private string _lastDirectory = "";
/// <summary>
/// Obtains a response stream as a string
/// </summary>
/// <param name="ftp">current FTP request</param>
/// <returns>String containing response</returns>
/// <remarks>FTP servers typically return strings with CR and
/// not CRLF. Use respons.Replace(vbCR, vbCRLF) to convert
/// to an MSDOS string</remarks>
private string GetStringResponse(FtpWebRequest ftp)
{
//Get the result, streaming to a string
string result = "";
using (FtpWebResponse response = (FtpWebResponse)ftp.GetResponse())
{
long size = response.ContentLength;
using (Stream datastream = response.GetResponseStream())
{
using (StreamReader sr = new StreamReader(datastream))
{
result = sr.ReadToEnd();
sr.Close();
}
datastream.Close();
}
response.Close();
}
return result;
}
/// <summary>
/// Gets the size of an FTP request
/// </summary>
/// <param name="ftp"></param>
/// <returns></returns>
/// <remarks></remarks>
private long GetSize(FtpWebRequest ftp)
{
long size;
using (FtpWebResponse response = (FtpWebResponse)ftp.GetResponse())
{
size = response.ContentLength;
response.Close();
}
return size;
}
#endregion
#region "Properties"
private string _hostname;
/// <summary>
/// Hostname
/// </summary>
/// <value></value>
/// <remarks>Hostname can be in either the full URL format
/// ftp://ftp.myhost.com or just ftp.myhost.com
/// </remarks>
public string Hostname
{
get
{
if (_hostname.StartsWith("ftp://"))
{
return _hostname;
}
else
{
return "ftp://" + _hostname;
}
}
set
{
_hostname = value;
}
}
private string _username;
/// <summary>
/// Username property
/// </summary>
/// <value></value>
/// <remarks>Can be left blank, in which case 'anonymous' is
returned</remarks>
public string Username
{
get
{
return (_username == "" ? "anonymous" : _username);
}
set
{
_username = value;
}
}
private string _password;
public string Password
{
get
{
return _password;
}
set
{
_password = value;
}
}
/// <summary>
/// The CurrentDirectory value
/// </summary>
/// <remarks>Defaults to the root '/'</remarks>
private string _currentDirectory = "/";
public string CurrentDirectory
{
get
{
//return directory, ensure it ends with /
return _currentDirectory + ((_currentDirectory.EndsWith("/")) ? "" :
"/").ToString();
}
set
{
if (!value.StartsWith("/"))
{
throw (new ApplicationException("Directory should start with /"));
}
_currentDirectory = value;
}
}
#endregion
}
#endregion
#region "FTP file info class"
/// <summary>
/// Represents a file or directory entry from an FTP listing
/// </summary>
/// <remarks>
/// This class is used to parse the results from a detailed
/// directory list from FTP. It supports most formats of
/// </remarks>
public class FTPfileInfo
{
//Stores extended info about FTP file
#region "Properties"
public string FullName
{
get
{
return Path + Filename;
}
}
public string Filename
{
get
{
return _filename;
}
}
public string Path
{
get
{
return _path;
}
}
public DirectoryEntryTypes FileType
{
get
{
return _fileType;
}
}
public long Size
{
get
{
return _size;
}
}
public DateTime FileDateTime
{
get
{
return _fileDateTime;
}
}
public string Permission
{
get
{
return _permission;
}
}
public string Extension
{
get
{
int i = this.Filename.LastIndexOf(".");
if (i >= 0 && i < (this.Filename.Length - 1))
{
return this.Filename.Substring(i + 1);
}
else
{
return "";
}
}
}
public string NameOnly
{
get
{
int i = this.Filename.LastIndexOf(".");
if (i > 0)
{
return this.Filename.Substring(0, i);
}
else
{
return this.Filename;
}
}
}
private string _filename;
private string _path;
private DirectoryEntryTypes _fileType;
private long _size;
private DateTime _fileDateTime;
private string _permission;
#endregion
/// <summary>
/// Identifies entry as either File or Directory
/// </summary>
public enum DirectoryEntryTypes
{
File,
Directory
}
/// <summary>
/// Constructor taking a directory listing line and path
/// </summary>
/// <param name="line">The line returned from the detailed directory
list</param>
/// <param name="path">Path of the directory</param>
/// <remarks></remarks>
public FTPfileInfo(string line, string path)
{
//parse line
Match m = GetMatchingRegex(line);
if (m == null)
{
//failed
throw (new ApplicationException("Unable to parse line: " + line));
}
else
{
_filename = m.Groups["name"].Value;
_path = path;
Int64.TryParse(m.Groups["size"].Value, out _size);
//_size = System.Convert.ToInt32(m.Groups["size"].Value);
_permission = m.Groups["permission"].Value;
string _dir = m.Groups["dir"].Value;
if (_dir != "" && _dir != "-")
{
_fileType = DirectoryEntryTypes.Directory;
}
else
{
_fileType = DirectoryEntryTypes.File;
}
try
{
_fileDateTime = DateTime.Parse(m.Groups["timestamp"].Value);
}
catch (Exception)
{
_fileDateTime = Convert.ToDateTime(null);
}
}
}
private Match GetMatchingRegex(string line)
{
Regex rx;
Match m;
for (int i = 0; i <= _ParseFormats.Length - 1; i++)
{
rx = new Regex(_ParseFormats[i]);
m = rx.Match(line);
if (m.Success)
{
return m;
}
}
return null;
}
#region "Regular expressions for parsing LIST results"
/// <summary>
/// List of REGEX formats for different FTP server listing formats
/// </summary>
/// <remarks>
/// The first three are various UNIX/LINUX formats, fourth is for MS FTP
/// in detailed mode and the last for MS FTP in 'DOS' mode.
/// I wish VB.NET had support for Const arrays like C# but there you go
/// </remarks>
private static string[] _ParseFormats = new string[] {
"(?<dir>[\\-d])(?<permission>([\\-r][\\-w][\\-xs]){3})\\s+\\d+\\s+\\w+\\s+\\w+\\s+(?<size>\\d+)\\s+(?<timestamp>\\w+\\s+\\d+\\s+\\d{4})\\s+(?<name>.+)",
"(?<dir>[\\-d])(?<permission>([\\-r][\\-w][\\-xs]){3})\\s+\\d+\\s+\\d+\\s+(?<size>\\d+)\\s+(?<timestamp>\\w+\\s+\\d+\\s+\\d{4})\\s+(?<name>.+)",
"(?<dir>[\\-d])(?<permission>([\\-r][\\-w][\\-xs]){3})\\s+\\d+\\s+\\d+\\s+(?<size>\\d+)\\s+(?<timestamp>\\w+\\s+\\d+\\s+\\d{1,2}:\\d{2})\\s+(?<name>.+)",
"(?<dir>[\\-d])(?<permission>([\\-r][\\-w][\\-xs]){3})\\s+\\d+\\s+\\w+\\s+\\w+\\s+(?<size>\\d+)\\s+(?<timestamp>\\w+\\s+\\d+\\s+\\d{1,2}:\\d{2})\\s+(?<name>.+)",
"(?<dir>[\\-d])(?<permission>([\\-r][\\-w][\\-xs]){3})(\\s+)(?<size>(\\d+))(\\s+)(?<ctbit>(\\w+\\s\\w+))(\\s+)(?<size2>(\\d+))\\s+(?<timestamp>\\w+\\s+\\d+\\s+\\d{2}:\\d{2})\\s+(?<name>.+)",
"(?<timestamp>\\d{2}\\-\\d{2}\\-\\d{2}\\s+\\d{2}:\\d{2}[Aa|Pp][mM])\\s+(?<dir>\\<\\w+\\>){0,1}(?<size>\\d+){0,1}\\s+(?<name>.+)"
};
#endregion
}
#endregion
#region "FTP Directory class"
/// <summary>
/// Stores a list of files and directories from an FTP result
/// </summary>
/// <remarks></remarks>
public class FTPdirectory : List<FTPfileInfo>
{
public FTPdirectory()
{
//creates a blank directory listing
}
/// <summary>
/// Constructor: create list from a (detailed) directory string
/// </summary>
/// <param name="dir">directory listing string</param>
/// <param name="path"></param>
/// <remarks></remarks>
public FTPdirectory(string dir, string path)
{
foreach (string line in dir.Replace("\n",
"").Split(System.Convert.ToChar('\r')))
{
//parse
if (line != "")
{
this.Add(new FTPfileInfo(line, path));
}
}
}
/// <summary>
/// Filter out only files from directory listing
/// </summary>
/// <param name="ext">optional file extension filter</param>
/// <returns>FTPdirectory listing</returns>
public FTPdirectory GetFiles(string ext)
{
return this.GetFileOrDir(FTPfileInfo.DirectoryEntryTypes.File, ext);
}
/// <summary>
/// Returns a list of only subdirectories
/// </summary>
/// <returns>FTPDirectory list</returns>
/// <remarks></remarks>
public FTPdirectory GetDirectories()
{
return this.GetFileOrDir(FTPfileInfo.DirectoryEntryTypes.Directory, "");
}
//internal: share use function for GetDirectories/Files
private FTPdirectory GetFileOrDir(FTPfileInfo.DirectoryEntryTypes type,
string ext)
{
FTPdirectory result = new FTPdirectory();
foreach (FTPfileInfo fi in this)
{
if (fi.FileType == type)
{
if (ext == "")
{
result.Add(fi);
}
else if (ext == fi.Extension)
{
result.Add(fi);
}
}
}
return result;
}
public bool FileExists(string filename)
{
foreach (FTPfileInfo ftpfile in this)
{
if (ftpfile.Filename == filename)
{
return true;
}
}
return false;
}
private const char slash = '/';
public static string GetParentDirectory(string dir)
{
string tmp = dir.TrimEnd(slash);
int i = tmp.LastIndexOf(slash);
if (i > 0)
{
return tmp.Substring(0, i - 1);
}
else
{
throw (new ApplicationException("No parent for root"));
}
}
}
#endregion
}
- 3
- Microsoft Project >> Dragging Finish DateIn a Gantt view of my project (MSP2000), when I try to drag the Finish
date of a task, the whole task moves instead of increasing the
Duration. This happens for any task I try to change.
If I create a new task, it behaves the same until I set the Constraint
Type to As Soon As Possible. The task Start date automatically
changes to the Project Start date. Only then I can drag the finish
date to extend the duration.
In a new project file, I can drag the Finish Date as per design.
Help?
Fred
- 4
- Net Framework >> Is this s bug?Hi All
I have one query, and need urgent help here. It is related with Windows
Address
Book(WAB). Suppose I open a link to WAB through my application's (developed
in VC++) dialog box. Now, if I get the focus back on my dialog box with the
WAB still opened(not in focus though), I cannot navigate through the
controls in my dialog box through the TAB key. Also, ENTER key does not
work. But the dialog box starts responding to the TAB and ENTER keys as soon
as WAB is closed. Why is it happening like this. I had downloaded a sample
WAB program from www.microsoft.com and this program too had the same
problem. I want to know if it is a bug or a normal behavior in VC++ and WAB
integration. Is there any workaround to this problem.
Thanks for your time.
Regards,
AA
- 5
- Microsoft Project >> Creating Custom LegendsI'm trying to create custom legends for my schedules - I can create them in
Page Setup but they show up on the print out. Please let me know if you have
any tips on creating legends.
Thanks for your help
- 6
- Net Framework >> Get LOGON USER name in .NET 2.0I recentlly converted some web services to 2.0. So far everything has worked
great with the exception of one of the functions in an AD service.
the following code:
string sUser = HttpContext.Current.Request.ServerVariables["LOGON_USER"];
Worksk fine if debugging in VS 2005 but when I publish to the server. An
empty string is returned. I have tried to catch an error and does not appear
to be one.
- 7
- Visual C#.Net >> CS0536 ErrorThis is a multi-part message in MIME format.
------=_NextPart_000_000B_01C383D6.38C91C90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi All,
I'm trying to generate a C# wrapper for a Windows type library using the =
following command line ...
csc /target:library /doc:Interop.MyLibrary.xml /unsafe =
Interop.MyLibrary.cs >Interop.MyLibrary.log
And receiving the following error message ...
Interop.MyLibrary.cs(499,18): error CS0536: =
'Interop.MyLibrary.IImpBaseCollection_SinkHelper' does not implement =
interface member 'Interop.MyLibrary.IImpBaseCollection.Item(object)'. =
'Interop.MyLibrary.IImpBaseCollection_SinkHelper.Item(object)' is either =
static, not public, or has the wrong return type.
Here's the code....
The line where the error occurs is in Bold Blue
Any ideas appreciated!! ;-)
Thanks,
Roland
-----------------
/// <summary><para><c>IImpBaseCollection</c> interface.</para></summary>
[Guid("5616A320-AB4D-11D0-8E2F-00A0C9050603")]
[ComImport]
[TypeLibType((short)4096)]
[DefaultMember("Item")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
public interface IImpBaseCollection: System.Collections.IEnumerable
{
/// <summary><para><c>Item</c> method of <c>IImpBaseCollection</c> =
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Item</c> method was =
the following: <c>HRESULT Item (VARIANT nIndex, [out, retval] =
IDispatch** ReturnValue)</c>;</para></remarks>
// IDL: HRESULT Item (VARIANT nIndex, [out, retval] IDispatch** =
ReturnValue);
// VB6: Function Item (ByVal nIndex As Any) As IDispatch
[DispId(0)]
[return: MarshalAs(UnmanagedType.IDispatch)]
object Item (object nIndex);
/// <summary><para><c>_NewEnum</c> property of <c>IImpBaseCollection</c> =
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>_NewEnum</c> =
property was the following: <c>IUnknown* _NewEnum</c>;</para></remarks>
// IDL: IUnknown* _NewEnum;
// VB6: _NewEnum As IUnknown
object _NewEnum
{
// IDL: HRESULT _NewEnum ([out, retval] IUnknown** ReturnValue);
// VB6: Function _NewEnum As IUnknown
[DispId(-4)]
[return: MarshalAs(UnmanagedType.IUnknown)]
get;
}
/// <summary><para>Parent property of IImpBaseCollection =
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Parent</c> property =
was the following: <c>IDispatch* Parent</c>;</para></remarks>
// IDL: IDispatch* Parent;
// VB6: Property Parent As IDispatch
[DispId(2)]
object Parent
{
[return: MarshalAs(UnmanagedType.IDispatch)]
get;
}
/// <summary><para>Count property of IImpBaseCollection =
interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Count</c> property =
was the following: <c>long Count</c>;</para></remarks>
// IDL: long Count;
// VB6: Property Count As Long
[DispId(3)]
int Count
{
get;
}
}
/// <summary><para>Delegate for handling <c>Item</c> event of =
<c>IImpBaseCollection</c> interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>Item</c> event was =
the following: <c>HRESULT IImpBaseCollection_ItemEventHandler (VARIANT =
nIndex, [out, retval] IDispatch** ReturnValue)</c>;</para></remarks>
// IDL: HRESULT IImpBaseCollection_ItemEventHandler (VARIANT nIndex, =
[out, retval] IDispatch** ReturnValue);
// VB6: Function IImpBaseCollection_ItemEventHandler (ByVal nIndex As =
Any) As IDispatch
[return: MarshalAs(UnmanagedType.IDispatch)]
public delegate object IImpBaseCollection_ItemEventHandler (object =
nIndex);
/// <summary><para>Delegate for handling <c>_NewEnum</c> event of =
<c>IImpBaseCollection</c> interface.</para></summary>
/// <remarks><para>An original IDL definition of <c>_NewEnum</c> event =
was the following: <c>HRESULT IImpBaseCollection__NewEnumEventHandler =
([out, retval] IUnknown** ReturnValue)</c>;</para></remarks>
// IDL: HRESULT IImpBaseCollection__NewEnumEventHandler ([out, retval] =
IUnknown** ReturnValue);
// VB6: Function IImpBaseCollection__NewEnumEventHandler As IUnknown
[return: MarshalAs(UnmanagedType.IUnknown)]
public delegate object IImpBaseCollection__NewEnumEventHandler () /* =
property get method */;
/// <summary><para>Declaration of events of <c>IImpBaseCollection</c> =
source interface.</para></summary>
[ComEventInterface(typeof(IImpBaseCollection),typeof(IImpBaseCollection_E=
ventProvider))]
[ComVisible(false)]
public interface IImpBaseCollection_Event
{
/// <summary><para><c>Item</c> event of <c>IImpBaseCollection</c> =
interface.</para></summary>
event IImpBaseCollection_ItemEventHandler Item;
/// <summary><para><c>_NewEnum</c> event of <c>IImpBaseCollection</c> =
interface.</para></summary>
event IImpBaseCollection__NewEnumEventHandler _NewEnum;
}
[ClassInterface(ClassInterfaceType.None)]
internal class IImpBaseCollection_SinkHelper: IImpBaseCollection
{
public int Cookie =3D 0;
public event IImpBaseCollection_ItemEventHandler ItemDelegate =3D null;
public void Set_ItemDelegate(IImpBaseCollection_ItemEventHandler deleg)
{
ItemDelegate =3D deleg;
}
public bool Is_ItemDelegate(IImpBaseCollection_ItemEventHandler deleg)
{
return (ItemDelegate =3D=3D deleg);
}
public void Clear_ItemDelegate()
{
ItemDelegate =3D null;
}
void Item (object nIndex)
{
if (ItemDelegate!=3Dnull)
ItemDelegate(nIndex);
}
public event IImpBaseCollection__NewEnumEventHandler _NewEnumDelegate =
=3D null;
public void Set__NewEnumDelegate(IImpBaseCollection__NewEnumEventHandler =
deleg)
{
_NewEnumDelegate =3D deleg;
}
public bool Is__NewEnumDelegate(IImpBaseCollection__NewEnumEventHandler =
deleg)
{
return (_NewEnumDelegate =3D=3D deleg);
}
public void Clear__NewEnumDelegate()
{
_NewEnumDelegate =3D null;
}
void _NewEnum () /* property get method */
{
if (_NewEnumDelegate!=3Dnull)
_NewEnumDelegate();
}
}
------=_NextPart_000_000B_01C383D6.38C91C90
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>Hi All,</DIV>
<DIV> </DIV>
<DIV>I'm trying to generate a C# wrapper for a Windows type library =
using the=20
following command line ...</DIV>
<DIV> </DIV>
<DIV><STRONG>csc /target:library /doc:Interop.MyLibrary.xml /unsafe=20
Interop.MyLibrary.cs >Interop.MyLibrary.log</STRONG></DIV>
<DIV> </DIV>
<DIV>And receiving the following error message ...</DIV>
<DIV> </DIV>
<DIV><FONT face=3Dt color=3D#0000ff>Interop.MyLibrary.cs(499,18): error =
CS0536:=20
'Interop.MyLibrary.IImpBaseCollection_SinkHelper' does not implement =
interface=20
member 'Interop.MyLibrary.IImpBaseCollection.Item(object)'.=20
'Interop.MyLibrary.IImpBaseCollection_SinkHelper.Item(object)' is either =
static,=20
not public, or has the wrong return type.</FONT></DIV>
<DIV> </DIV>
<DIV>Here's the code....</DIV>
<DIV> </DIV>
<DIV><FONT size=3D2><FONT color=3D#808080><FONT color=3D#000000 =
size=3D3>The line where=20
the error occurs is in <STRONG><FONT color=3D#0000ff>Bold=20
Blue</FONT></STRONG></FONT></FONT></FONT></DIV>
<DIV> </DIV>
<DIV>Any ideas appreciated!! ;-)</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Roland</DIV>
<DIV> </DIV>
<DIV>-----------------</DIV>
<DIV> </DIV>
<DIV><FONT size=3D2><FONT color=3D#808080></FONT></FONT> </DIV>
<DIV><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT =
color=3D#008000>=20
</FONT><FONT =
color=3D#808080><summary><para><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></DIV>
<DIV></FONT></FONT>
<P><FONT =
size=3D2>[Guid("5616A320-AB4D-11D0-8E2F-00A0C9050603")]</FONT></P>
<P><FONT size=3D2>[ComImport]</FONT></P>
<P><FONT size=3D2>[TypeLibType((<FONT =
color=3D#0000ff>short</FONT>)4096)]</FONT></P>
<P><FONT size=3D2>[DefaultMember("Item")]</FONT></P>
<P><FONT=20
size=3D2>[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]<=
/FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>interface</FONT> IImpBaseCollection:=20
System.Collections.IEnumerable</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para><c></FONT><FONT=20
color=3D#008000>Item</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000> method of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>Item</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000> method was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>HRESULT Item =
(VARIANT nIndex,=20
[out, retval] IDispatch** ReturnValue)</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: HRESULT Item (VARIANT =
nIndex, [out,=20
retval] IDispatch** ReturnValue);</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Function Item (ByVal =
nIndex As Any)=20
As IDispatch</FONT></P></FONT>
<P><STRONG><FONT color=3D#ff0000>[DispId(0)]</FONT></STRONG></P>
<P><STRONG><FONT color=3D#ff0000>[return:=20
MarshalAs(UnmanagedType.IDispatch)]</FONT></STRONG></P>
<P><STRONG><FONT color=3D#ff0000>object Item (object =
nIndex);</FONT></STRONG></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para><c></FONT><FONT=20
color=3D#008000>_NewEnum</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> property of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>_NewEnum</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> property was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>IUnknown* =
_NewEnum</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: IUnknown*=20
_NewEnum;</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: _NewEnum As=20
IUnknown</FONT></P></FONT>
<P><FONT size=3D2><FONT color=3D#0000ff>object</FONT> =
_NewEnum</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: HRESULT _NewEnum ([out, =
retval]=20
IUnknown** ReturnValue);</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Function _NewEnum As=20
IUnknown</FONT></P></FONT>
<P><FONT size=3D2>[DispId(-4)]</FONT></P>
<P><FONT size=3D2>[<FONT color=3D#0000ff>return</FONT>:=20
MarshalAs(UnmanagedType.IUnknown)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>get</FONT>;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para></FONT><FONT =
color=3D#008000>Parent=20
property of IImpBaseCollection interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>Parent</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> property was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>IDispatch* =
Parent</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: IDispatch* =
Parent;</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Property Parent As=20
IDispatch</FONT></P></FONT>
<P><FONT size=3D2>[DispId(2)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>object</FONT> Parent</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2>[<FONT color=3D#0000ff>return</FONT>:=20
MarshalAs(UnmanagedType.IDispatch)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>get</FONT>;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para></FONT><FONT =
color=3D#008000>Count=20
property of IImpBaseCollection interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>Count</FONT><FONT color=3D#808080></c></FONT><FONT =
color=3D#008000> property was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>long =
Count</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: long =
Count;</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Property Count As=20
Long</FONT></P></FONT>
<P><FONT size=3D2>[DispId(3)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>int</FONT> Count</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>get</FONT>;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para></FONT><FONT =
color=3D#008000>Delegate for=20
handling </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>Item</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000> event of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>Item</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000> event was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>HRESULT=20
IImpBaseCollection_ItemEventHandler (VARIANT nIndex, [out, retval] =
IDispatch**=20
ReturnValue)</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: HRESULT=20
IImpBaseCollection_ItemEventHandler (VARIANT nIndex, [out, retval] =
IDispatch**=20
ReturnValue);</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Function=20
IImpBaseCollection_ItemEventHandler (ByVal nIndex As Any) As=20
IDispatch</FONT></P></FONT>
<P><FONT size=3D2>[<FONT color=3D#0000ff>return</FONT>:=20
MarshalAs(UnmanagedType.IDispatch)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>delegate</FONT> <FONT color=3D#0000ff>object</FONT>=20
IImpBaseCollection_ItemEventHandler (<FONT color=3D#0000ff>object</FONT> =
nIndex);</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para></FONT><FONT =
color=3D#008000>Delegate for=20
handling </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>_NewEnum</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> event of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><remarks><para></FONT><FONT =
color=3D#008000>An original=20
IDL definition of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>_NewEnum</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> event was the following: </FONT><FONT=20
color=3D#808080><c></FONT><FONT color=3D#008000>HRESULT=20
IImpBaseCollection__NewEnumEventHandler ([out, retval] IUnknown**=20
ReturnValue)</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000>;</FONT><FONT=20
color=3D#808080></para></remarks></P></FONT></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// IDL: HRESULT=20
IImpBaseCollection__NewEnumEventHandler ([out, retval] IUnknown**=20
ReturnValue);</FONT></P></FONT>
<P><FONT color=3D#008000><FONT size=3D2>// VB6: Function=20
IImpBaseCollection__NewEnumEventHandler As IUnknown</FONT></P></FONT>
<P><FONT size=3D2>[<FONT color=3D#0000ff>return</FONT>:=20
MarshalAs(UnmanagedType.IUnknown)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>delegate</FONT> <FONT color=3D#0000ff>object</FONT>=20
IImpBaseCollection__NewEnumEventHandler () <FONT color=3D#008000>/* =
property get=20
method */</FONT>;</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para></FONT><FONT =
color=3D#008000>Declaration=20
of events of </FONT><FONT color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> source=20
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2>[ComEventInterface(<FONT=20
color=3D#0000ff>typeof</FONT>(IImpBaseCollection),<FONT=20
color=3D#0000ff>typeof</FONT>(IImpBaseCollection_EventProvider))]</FONT><=
/P>
<P><FONT size=3D2>[ComVisible(<FONT =
color=3D#0000ff>false</FONT>)]</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>interface</FONT> IImpBaseCollection_Event</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para><c></FONT><FONT=20
color=3D#008000>Item</FONT><FONT color=3D#808080></c></FONT><FONT=20
color=3D#008000> event of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#0000ff>event</FONT>=20
IImpBaseCollection_ItemEventHandler Item;</FONT></P>
<P><FONT size=3D2><FONT color=3D#808080>///</FONT><FONT color=3D#008000> =
</FONT><FONT=20
color=3D#808080><summary><para><c></FONT><FONT=20
color=3D#008000>_NewEnum</FONT><FONT =
color=3D#808080></c></FONT><FONT=20
color=3D#008000> event of </FONT><FONT =
color=3D#808080><c></FONT><FONT=20
color=3D#008000>IImpBaseCollection</FONT><FONT=20
color=3D#808080></c></FONT><FONT color=3D#008000> =
interface.</FONT><FONT=20
color=3D#808080></para></summary></P></FONT></FONT>
<P><FONT size=3D2><FONT color=3D#0000ff>event</FONT>=20
IImpBaseCollection__NewEnumEventHandler _NewEnum;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2>[ClassInterface(ClassInterfaceType.None)]</FONT></P>
<P><FONT color=3D#0000ff><STRONG>internal class =
IImpBaseCollection_SinkHelper:=20
IImpBaseCollection</STRONG></FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT =
color=3D#0000ff>int</FONT>=20
Cookie =3D 0;</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>event</FONT> IImpBaseCollection_ItemEventHandler =
ItemDelegate =3D=20
<FONT color=3D#0000ff>null</FONT>;</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>void</FONT> =
Set_ItemDelegate(IImpBaseCollection_ItemEventHandler=20
deleg)</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2>ItemDelegate =3D deleg;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>bool</FONT> =
Is_ItemDelegate(IImpBaseCollection_ItemEventHandler=20
deleg)</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>return</FONT> (ItemDelegate =
=3D=3D=20
deleg);</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>void</FONT> Clear_ItemDelegate()</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2>ItemDelegate =3D <FONT =
color=3D#0000ff>null</FONT>;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><STRONG><FONT color=3D#ff0000>void Item (object =
nIndex)</FONT></STRONG></P>
<P><STRONG><FONT color=3D#ff0000>{</FONT></STRONG></P>
<P><STRONG><FONT color=3D#ff0000>if =
(ItemDelegate!=3Dnull)</FONT></STRONG></P>
<P><STRONG><FONT =
color=3D#ff0000>ItemDelegate(nIndex);</FONT></STRONG></P>
<P><STRONG><FONT color=3D#ff0000>}</FONT></STRONG></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>event</FONT> IImpBaseCollection__NewEnumEventHandler=20
_NewEnumDelegate =3D <FONT color=3D#0000ff>null</FONT>;</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>void</FONT>=20
Set__NewEnumDelegate(IImpBaseCollection__NewEnumEventHandler =
deleg)</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2>_NewEnumDelegate =3D deleg;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>bool</FONT>=20
Is__NewEnumDelegate(IImpBaseCollection__NewEnumEventHandler =
deleg)</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>return</FONT> (_NewEnumDelegate =
=3D=3D=20
deleg);</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>public</FONT> <FONT=20
color=3D#0000ff>void</FONT> Clear__NewEnumDelegate()</FONT></P>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2>_NewEnumDelegate =3D <FONT =
color=3D#0000ff>null</FONT>;</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>void</FONT> _NewEnum () <FONT=20
color=3D#008000>/* property get method */</P></FONT></FONT>
<P><FONT size=3D2>{</FONT></P>
<P><FONT size=3D2><FONT color=3D#0000ff>if</FONT> =
(_NewEnumDelegate!=3D<FONT=20
color=3D#0000ff>null</FONT>)</FONT></P>
<P><FONT size=3D2>_NewEnumDelegate();</FONT></P>
<P><FONT size=3D2>}</FONT></P>
<P><FONT size=3D2>}</FONT><FONT size=3D1></P></FONT></DIV></BODY></HTML>
------=_NextPart_000_000B_01C383D6.38C91C90--
- 8
- Dotnet >> XtraReports?Anyone is using XtraReports from www.devexpress.com?
Seems like a great piece of software and the price is right. Comments,
opinions?
Thanks!
- 9
- Dotnet >> Process CPU usage jumps to 100% without any reason?I am working on an application in c# that runs in the background.
All it does is monitor a value from a performance counter using a timer. It then draws these values in a chart
Now, this application works for a long time, sometimes even days. But sometimes it just freezes and the CPU usag
spikes to 100% for that process. I really don't understand why, and there seems to be no actual event that trigger
this. It looks like this problem occures more when I am using more CPU power during a long period of tim
(f.e. when compressing something). But even then, sometimes the program freezes and sometimes it keeps running
smooth at 0-2% usage..
Is there anyone that can give me an idea on how to solve this problem
I thank you for your time
Kind regards
Kevin Chabot
- 10
- Dotnet >> Dynamically creating a Word documentI want to create a Word document that will display data from a database. I
don't want to create the file on the server, I just want to stream it out
directly to the user. When they click a button, the Word Save Open window
will open, and allow the user to Save or Open the document in Word. I know I
need to use response.binarywrite, but I don't know if it is possible to
create the binary object without first saving it to a temporary file. Would
I need to create a Word template, and how would I use it?
How would I get data from a data grid into this document?
- 11
- Visual C#.Net >> Folder rights...I'm creating a new folder using Directory.CreateDirectory() method.
How to set "FullControl" rights to "Everyone" group on this folder?
Where to obtain an "Everyone" identity string? I can't just put
"Everyone" cause in f.e. Polish version this group names "Wszyscy" ...
- 12
- Visual C#.Net >> Creating a dynamic array...Hello.
I have figured out how to create an instance of an object only knowing the
type by string.
string sName = "MyClassName";
Type t = Type.GetType(sName);
Object objNew = Activator.CreateInstance(t);
This works, but now I need to declare an array like
Object[] objNew = Activator.CreateInstance(t)[0];
This doesn't work. Can anyone help?
Thanks.
Matthew Wells
Matthew.Wells@FirstByte.net
- 13
- Visual C#.Net >> Installing a font using C#Hi
I was wondering if anyone knows how to install a system font using C#?
I know it doesn´t do the trick to simply copy the font to the font
directory, it just doesn´t become active.
Any ideas?
/Johan
- 14
- Net Framework >> .Net Framework 1.1 SP1 brok COM+ componentsAfter installing SP1 for the .Net framework 1.1 on a Windows 2000 server, all
the COM+ components ceased to be accessible from my VB6 applications. The
only error that was received was that it could not load the dll. I ended up
deleting the components and reapplying them with regsvcs.
Fortunately, we only have a few .Net COM+ components being accessed by VB6.
Has anyone else seen this?
- 15
- Visual C#.Net >> Postfix incrementHello!
I have found an interesting thing with postfix operator ++.
What should contain the variable i after exceution the following code:
int i = 5;
i = i++;
In VC++ 7.1 and VC++ 2005 beta 2 the variable i contains 6.
But in C# 7.1 and C# 2005 beta 2 the variable i contains 5.
Is it behaviour correct? Can anyone explain what is the correct result?
Best regards,
Oleg.
|
| Author |
Message |
Àî˼Áú

|
Posted: Tue Aug 23 00:56:00 CDT 2005 |
Top |
Microsoft Project >> missing stuff when opening msp2003 file in msp2002
help!
i emailed my mpp file from the office to myself at home.
i seem to have lost my recurring tasks when i tried to open my msp2003 file
in msp2002.
does anyone know about this?
is there a fix?
DotNet433
|
| |
|
| |
 |
Rod

|
Posted: Tue Aug 23 00:56:00 CDT 2005 |
Top |
Microsoft Project >> missing stuff when opening msp2003 file in msp2002
There should have been no problem with Project 2000, or 2002 reading a
recurring task. I suspect a file corruption. Try emailing the file again.
--
Rod Gill
Project MVP
Visit www.msproject-systems.com for Project Companion Tools and more
"Eva" <erabeyatwestnetdotcomdotau> wrote in message
news:4309ea40$EMail@HideDomain.com...
> help!
> i emailed my mpp file from the office to myself at home.
> i seem to have lost my recurring tasks when i tried to open my msp2003
> file in msp2002.
> does anyone know about this?
> is there a fix?
>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Microsoft Project |
- Next
- 1
- 2
- Net Framework >> Installing .net framework 3.0The uninstall tool indicates that all previous installs have been
uninstalled. The download of 30MB but then just as the installation starts I
get the error log:
[09/29/06,21:45:35] VS Scenario: [2] CPrevProductInstalledCheck failed :
<font face=Verdana size=8pt>
Thank you for participating in the Beta program. You must uninstall all
pre-release products in a specific order before you can continue with setup.
For detailed information, see the <a color=#3F4F7F HOVER-COLOR=#C3120C
href="http://go.microsoft.com/fwlink/?LinkId=54981">uninstall support
page</a> and the <a color=#3F4F7F HOVER-COLOR=#C3120C
href="http://go.microsoft.com/fwlink/?LinkId=70837">readme</a>.<br> -
WinFX Runtime Components 3.0 - Beta 2<br> - Windows Communication
Foundation
[09/29/06,21:45:36] VS Scenario: [2] Failed to pass the Warnings/Blocks
checks in CVSScenario::Start()
[09/29/06,22:12:18] VS Scenario: [2] CPrevProductInstalledCheck failed :
<font face=Verdana size=8pt>
--
David Houliston
MCAD
- 3
- ADO >> Visual Studio 2003 Issue - Error when defining TableMappings on DataAdapterWe recently upgraded our MSDN Version of VS.NET 2002 to VS.NET 2003...
Things are all working well, except we've run across a new bug or issue
since our adopting of the new package.
Before I give the error message, let me preface it with a brief description
of how our 1-tierd data environment is setup. (Note: we do get the same
errors on multi-tiered apps as well and originally it was thought that our
error lied in the way we were having our dataaccess objects inherit
connections from base objects... but anyway, it's not ... ).
In a typical web application of ours, we have an appsetting called
"MainDBConnection" within the Web.Config file. The data w/in the variable
looks something like this:
<add key="MainDBConnection" value="data source=OurServerName;initial
catalog=OurDB;persist security info=False;user
id=mikej;password=mypassword;workstation id=MIKEJ;packet size=4096" />
The connectionString was one that was actually generated by VS.NET and then
copied/pasted into here. Anyway, in the designer, and connection that is
defined points to the value through the Dynamic Properties -->
ConnectionString area of the Properties Window... Everything looks good...
it retrieves the value from the Web.Config and any command object works
nicely w/ it... nicely meaning that I can define queries in the designer and
VS.NET can communicate w/ the DB for parameter generation and all that
jazz...
Here's where the problem comes in... Ok... so imagine I've defined a
connection object (pointing to my config data), a command object (pointing
to the connection) and a dataAdapter (using the command object as its
SelectCommmand Property) ... When I click on the button to define
TableMappings in my property window for the dataAdapter I get the following
error:
Unable to retrieve the schema from the database table. Source column
mapping information will not be available. Would you like to continue?
What!?!? This is where I'm confused... VS.NET can access the DB when I'm
defining my Select Command's CommandText property. Why can't it when I'm
defining my tableMappings? Another thing that confuses me is that
everything worked fine in the previous version of VS.NET... Bug addition? ;)
It's probably some bad convention I'm using in setting up a dynamic
connection, but if anyone has a way for this to work, pleeeeeeeease let me
know. Additionally, whenever I open up an object like this in the designer,
I get another error saying, "Exception has been thrown by the target of an
invocation" and then the designer erases my table mappings again and I have
to repeat the whole annoying process of having to fix it again... Funny
thing is that this is only new w/ version 2003 :( I shouldn't have upgraded
all my projects... Now I'm stuck with it and though I've developed many new
methodologies, I still have to figure out how to get this old stuff working
for maintenance purposes. I have figured out some workarounds for the
issue, but it's such a productivity killer to get it going again as I have
not found a consistent method for kickstarting it...
While I'm on the subject, I'll describe how I get around it. There are 2
ways I have taken care of this:
1. Add this to the dataadapter in the object constructor (This still doesn't
fix it working in the designer, but allows me to compile):
- MyDataAdapter.TableMappings.Add("Table", "MyNewTable")
2. If I really, really want my designer to work right, I can tinker around
w/ Visual Studio enough so that it prompts me for my SQLServer Username and
password (and I guess VS saves that info in memory 'til I close it)... after
that, the Designer's table mappings work again. How do you get that
user/password prompt you ask? I usually have to define a new connection for
the DB and then change it back after it has prompted me. This way works the
best, but is still just a big pain in the butt because everytime I *open* a
page in the designer it clears out my table mappings until I fix the
problem... again and again
Also, one thing that has already been suggested and tried is changing the
'persist security info=False' to True, but that didn't work either :)
Thanks for your time,
Mike Joseph
Hypersite.net
- 4
- Dotnet >> Logging Into a ServerHello All,
I'm hoping someone can point me in the right direction. This is outside of
my experience with VB. I have an application (written in VB.NET) that
allows a user to enter a part of the file name and all file matches in a
specific
directory are copied to the user's desktop. It's a simple but useful tool.
Now an outside company requires access to the data. The files have been
moved to a Windows 2000 server accessible via the internet (i.e. outside the
firewall) so the other company can access the files. Both companies are
going to use this program. Since this server is not on our (or any) domain
I must log into that server. Therein lies my question. How do I
programmatically supply a user name and password to the server? We do not
want the other company to know the user name and password to the server.
The "best" solution is a web application, but I need to get this working
immediately and I haven't much experience with ASP.
Thank you for your help.
Chris
- 5
- Microsoft Project >> error: valid product key must be set to create an admin imageI'm trying to set up an administrative installation point for project 2002
professional including MUI-packs (german; maybe french, too). When installing
the MUI-Pack to the administrative share using the usual command
"<cdrom>:\1031\setup /a"
the setup stops after completing all dialogs (accept, installation path)with
installer error
"A valid Product Key must be set to create an Admin image"
I was never asked for a licensing key and IMHO the MUI kits don't handle
licensing, anyway. I'm using Project 2002 pro with volume licensing key and
the MUI CD2 from MSDN Subscriber Downloads. Poject 2002 us-english
kernel runs without problems.
It's independent of the installation path I choose.
Ideas?
- 6
- Dotnet >> GetCurrentDirectory questionI am using asp.net and have some code in a file in the App_Code
directory. I also have a text file in the same directory that I want
to access. This file will always br in the same directory but I will
not know the absolute path.
When I try...
Dim s As String = Directory.GetCurrentDirectory
I get
'c:\program files\microsoft visual studio 8\common7\IDE'
which is not the current directory of the code file that this is being
called from.
What am I missing?
Pb
- 7
- Visual C#.Net >> VB to C sharp anyone can point out which is the equivalentI'm learning C sharp and do not like vb much. I'm creatiing a wepage using
panel to test myself. I tried to use these code below, which is written in
VB, and to transform them to c sharp but I got hard time to understand vb
syntax. I don't know if anyone in here can point out which is the equivalent
object used in c sharp.
Translate these two lines to C sharp:
Sub Next_Click(Sender As Object, e As EventArgs)
Select Case Sender.Parent.ID
Thanks
<%@ Page Language="vb" %>
<html>
<head>
<script runat="server">
Sub Page_Load()
If Not IsPostBack Then
Step1.Font.Bold = True
End If
End Sub
Sub Next_Click(Sender As Object, e As EventArgs)
Select Case Sender.Parent.ID
Case "Page1"
Page1.Visible = False
Step1.Font.Bold = False
Page2.Visible = True
Step2.Font.Bold = True
Case "Page2"
Page2.Visible = False
Step2.Font.Bold = False
Page3.Visible = True
Step3.Font.Bold = True
ReviewFName.Text &= FirstName.Text
ReviewMName.Text &= MiddleName.Text
ReviewLName.Text &= LastName.Text
ReviewEmail.Text &= Email.Text
ReviewAddress.Text &= Address.Text
ReviewCity.Text &= City.Text
ReviewState.Text &= State.Text
ReviewZip.Text &= Zip.Text
End Select
End Sub
Sub Previous_Click(Sender As Object, e As EventArgs)
Select Case Sender.Parent.ID
Case "Page2"
Page2.Visible = False
Step2.Font.Bold = False
Page1.Visible = True
Step1.Font.Bold = True
Case "Page3"
Page3.Visible = False
Step3.Font.Bold = False
Page2.Visible = True
Step2.Font.Bold = True
End Select
End Sub
</script>
<style type="text/css">
div
{
background:silver;
width:400px;
border:2px outset;
margin:5px;
padding:5px;
}
</style>
</head>
<body>
<form runat="server">
<asp:label id="RegWiz" text="Registration Wizard" font-bold="true"
font-size="16" font-name="verdana" runat="server"/>
<br/>
<asp:label id="Step1" text="Step 1: Enter Personal Info"
font-name="verdana" runat="server"/>
<br/>
<asp:label id="Step2" text="Step 2: Enter Address Info"
font-name="verdana" runat="server"/>
<br/>
<asp:label id="Step3" text="Step 3: Review" font-name="verdana"
runat="server"/>
<br/>
<asp:panel id="Page1" runat="server">
<table align="center">
<tr>
<td>
<asp:label id="FirstNameLabel" text="First Name:"
runat="server"/>
</td>
<td>
<asp:textbox id="FirstName" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="MiddleNameLabel" text="Middle Name:"
runat="server"/>
</td>
<td>
<asp:textbox id="MiddleName" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="LastNameLabel" text="Last Name:"
runat="server"/>
</td>
<td>
<asp:textbox id="LastName" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="EmailLabel" text="Email:" runat="server"/>
</td>
<td>
<asp:textbox id="Email" runat="server"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:button id="P1Previous" Text="Previous"
enabled="false" onclick="Previous_Click" runat="server"/>
<asp:button id="P1Next" Text="Next" onclick="Next_Click"
runat="server"/>
<input id="P1Reset" type="reset" runat="server"/>
</td>
</tr>
</table>
</asp:panel>
<asp:panel id="Page2" visible="false" runat="server">
<table align="center">
<tr>
<td>
<asp:label id="AddressLabel" text="Street Address:"
runat="server"/>
</td>
<td>
<asp:textbox id="Address" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="CityLabel" text="City:" runat="server"/>
</td>
<td>
<asp:textbox id="City" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="StateLabel" text="State:" runat="server"/>
</td>
<td>
<asp:textbox id="State" runat="server"/>
</td>
</tr>
<tr>
<td>
<asp:label id="ZipLabel" text="Zip Code:" runat="server"/>
</td>
<td>
<asp:textbox id="Zip" runat="server"/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:button id="P2Previous" Text="Previous"
onclick="Previous_Click" runat="server"/>
<asp:button id="P2Next" Text="Next" onclick="Next_Click"
runat="server"/>
<input id="P2Reset" type="reset" runat="server"/>
</td>
</tr>
</table>
</asp:panel>
<asp:panel id="Page3" visible="false" runat="server">
<table align="center">
<tr>
<td colspan="2">
<asp:label id="ReviewFName" text="First Name: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewMName" text="Middle Name: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewLName" text="Last Name: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewEmail" text="Email: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewAddress" text="Address: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewCity" text="City: " runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewState" text="State: "
runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:label id="ReviewZip" text="Zip: " runat="server"/>
</td>
</tr>
<tr>
<td colspan="2">
<asp:button id="P3Previous" Text="Previous"
onclick="Previous_Click" runat="server"/>
<asp:button id="P3Next" Text="Next" enabled="false"
onclick="Next_Click" runat="server"/>
<input id="P3Reset" type="reset" disabled="true"
runat="server"/>
</td>
</td>
</tr>
</table>
</asp:panel>
</form>
</body>
</html>
- 8
- Visual C#.Net >> using HtmlInputFile problemHi,
I'm trying to upload a file and I do that with this code, but there is a
thing which doesn't work. I can't understand how to check if it isn't
written the path to the file(the text field of <input> control is empty) or
it is.
I have tryed with the following:
if( filMyFile.PostedFile != null) //HtmlInputFile filMyFile;
{
code
}
else
{
code
}
and with:
if(filMyFile.Value=="")
{
code
}
else
{
code
}
but everytime( when the text filed with the path is empty or filled) the if
statement works in same way.
How could be checked if the path is filled or it isn't?
Here is my code.Thank you in advance!
private void Button1_Click(object sender, System.EventArgs e)
{
msg.Text="";
if(filMyFile.PostedFile != null)
{
try
{
// Get a reference to PostedFile object
HttpPostedFile myFile = filMyFile.PostedFile;
// Get size of uploaded file
int nFileLen = myFile.ContentLength;
if(myFile.ContentType.CompareTo("image/gif")==0)
{
// Allocate a buffer for reading of the file
byte[] myData = new byte[nFileLen];
// Read uploaded file from the Stream
myFile.InputStream.Read(myData, 0, nFileLen);
string strFilename = Path.GetFileName(myFile.FileName);
string strDir = "c:\\Inetpub\\wwwroot\\Estates\\Files\\" +
Session["usrName"].ToString();
Directory.CreateDirectory( strDir);
string
strRoute=MapPath("/Estates/Files/"+Session["usrName"].ToString()+"/"+strFile
name);
//string strFilename = Path.GetFileName(myFile.FileName);
//string strRoute=MapPath("/Estates/Files/"+strFilename );
WriteToFile(strRoute,myData);
msg.Text="The file was attached";
}
else
{
msg.Text="This file is not a gif!!!";
}
}
catch(Exception exc)
{
msg.Text = "Error by saving: " + exc.ToString();
}
}
else
{
msg.Text="Please, atach your file!";
return;
}
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.729 / Virus Database: 484 - Release Date: 27.7.2004 a.
- 9
- 10
- ADO >> DataTable LimitationsI've found a MSDN reference to the fact that an ADO.NET DataTable is limited
to 16,777,216 rows of data [1], but what I cannot find is a reference for
the maximum columns per DataTable, maximum bytes per DataRow, etc. Is this
information documented anywhere?
TIA!
- Christopher
[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataDataTableClassTopic.asp
- 11
- Net Framework >> Calling URL through Proxy server(Address and Port)/Proxy ScriptHi All,
i m develpoing a .net Window application which has
4 texboxes(tbxURLmfor URL in URL Frame,tbxAddress for address in Proxy
server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy
script in proxy script frame) and a test button..The requirment is given below
STEP BY STEP GUIDE
1. Input the URL you want to test
2. Choose Proxy script/Proxy server with Address and Port Information/No proxy
3. Enter url to proxy script or info for proxy server in respective text box
4. Press test-button
---------------My Code is -------------------------------------------------
DateTime dt1 = DateTime.Now;
System.Net.HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(tbxURL.Text.ToString());
//GetResponse for this request.
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse();
DateTime dt2 = DateTime.Now;
lblTimeTaken.Text = Convert.ToString(dt2.Subtract(dt1));
--------------------------------------------------------------------
in this code , i m unable to set the value of proxy script textbox ,if any
or proxy server(Address and port) ,only thing which i do threough this code
is sending the url without any proxyscript ans proxy server(address and port
info) Can anybody tell me how can i do this thorugh the code....
..
i m working on window application as i need *.exe file rather than install
file ....
Thanks,
Deepak
- 12
- Dotnet >> Generate Expressions in a datasetHello there,
I was wondering if anyone knows if there is an easy way to import
expressions into my typed dataset from the original view/sql statement
For example if I drag a view from the server explorer onto my dataset I
would like it to import not just the caculated field but also the expression
that creates the field.
I think that an ORM mapper would probably do this for me but unfortunatly I
am stuck with datasets :(
Any ideas would be much appreciated, thank you
John Sheppard
- 13
- Visual C#.Net >> TV Directo TV online PLAYBOY TVhttp://www.zapateiro.com/tvc/tvo.htm
TV online
http://www.zapateiro.com/cine/playboy.htm
Ver PLAYBOY TV Gratis
Ver TokyoDrift Online Gratis
http://www.zapateiro.com/cine/piratas.htm
Ver Pirates of the Caribbean 2 Online Gratis
http://www.zapateiro.com/cine/harry.htm
Ver Harry Potter III Online Gratis
Ver Casino Royale 007 Online Gratis
http://www.zapateiro.com/todogratis/eurosport.htm
Ver EUROSPORT TV Gratis
- 14
- ADO >> database formatsTrying to compile a document of all industry standard database formats. I can
think of SQL Server, Access, DBASE, SyBASE, Oracle, and ASCII .
Does anybody know other formats or where I can get a description of database
formats?
Asking partly out of curiosity and partly because I'd like to tell my
customer all the database formats my wonderful ado.net application will be
able to support.
thanks!
Darius.
- 15
- Net Framework >> Disable / Enable single grid cellHi
I use a datatable as a datasource in my datagrid (win form).
I want the user to be able to edit certain columns but not in every
row.
anyone have a good idea how to do this?
So far I have tested to set the datasource to
Row.Table.Columns[ColumnID].ReadOnly = false;
but as you all probobly understand this causes that column to be
editible in every row..
I can't use .net 2.0 as this is a requirement so far.
Hope anyone has a good idea.
Daniel
|
|
|