Thanks. That did it :)
Ronald Hahn, CNT - Computer Engineering Technologist
Thanks. That did it :)
Ronald Hahn, CNT - Computer Engineering Technologist
Hi, I'm new to Threading and WPF and need some help Adding to my Combo Box. I Understand I can't touch the UI from a background thread I just cant seem to figure out the work around. I got This Far. You'll see a Combo1.Items.Add(f); That is throwing. If I can get a good example of how you are suppose to do something like this I'll have a chunk of code I can play with and learn from. Thank you very much For any help
private void button1_Click(object sender, RoutedEventArgs e)
{
string Server;
Server = cmdServers.SelectedItem.ToString();
FillApplicationCombo(Server);
}
void FillApplicationCombo( string Server)
{
int count;
string Path;
int Version;
string AppName;
Path = @"\\\\" + Server + @"\\" + "DOCFOCUS";
progressBar1.Minimum = 0;
progressBar1.Maximum = \_DirectoryFiles.Count;
\_Worker = new BackgroundWorker();
\_Worker.WorkerReportsProgress = true;
\_Worker.WorkerSupportsCancellation = true;
\_Worker.DoWork += (s, args) =>
{
BackgroundWorker worker = s as BackgroundWorker;
DirSearch(Path); //Gets All Files in the Path
count = 0;
foreach (string f in \_DirectoryFiles)
{
count++;
worker.ReportProgress(count);
AppName = FileVersionInfo.GetVersionInfo(f).ProductName;
if (AppName == null)
continue;
if (AppName.ToUpper().IndexOf("MYAPPNAME") == -1)
continue;
Version = FileVersionInfo.GetVersionInfo(f).ProductMajorPart;//FileVersion;
if (Version == 6)
{
Combo1.Items.Add(f);//What should I do about this?
}
}
};
\_Worker.RunWorkerCompleted += (s, args) =>
{
progressBar1.Value = 0;
};
\_Worker.ProgressChanged += (s, args) =>
{
progressBar1.Value = args.ProgressPercentage;
};
\_Worker.RunWorkerAsync();
}
Ronald Hahn, CN
Hi How can i include a formatted text field inside an xml document? ie:
< Paragraph>
<Color>Red</Color>
<Font>WingDings</Font>
<Text> this is the text & it needs to be able to hold all characters.
Formatting Info needs to
Be maintaind. So do things like this:
$1.56 < $2.25 & so on...
<Text
</Paragraph>
I've been mudling around with XmlSerializer but XmlSerializer.Deserialize dies on & and < ect. and looses formating. -- modified at 17:13 Friday 22nd September, 2006
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
The following functions are suppose to print multi page Tiff images but they don't. If I have a 2 page tiff it prints 2 copies of page one. I can't figure out how to get to the next page. The code is adapted from http://en.csharp-online.net/index.php?title=Graphics%2C_Multimedia%2C_and_Printing_Recipes%E2%80%94Recipe_8_15[^] public class TiffDocument : PrintDocument { private string _Tiff; private int _PageNumber=0; private int _NumberOfPages=0; //private int offset; public string Tif { get { return _Tiff; } set { _Tiff = value; } } public int PageNumber { get { return _PageNumber; } set {_PageNumber = value;} } public int NumberOfPages { get { return _NumberOfPages; } set { _NumberOfPages = value; } } public TiffDocument(string tif) { this._Tiff = tif; if(File.Exists(tif)) { Image i = Image.FromFile(tif); FrameDimension myFrame = new FrameDimension(i.FrameDimensionsList[0]); _NumberOfPages = i.GetFrameCount(myFrame); } } } private void doc_PrintTiff(object sender, PrintPageEventArgs e) { TiffDocument doc = (TiffDocument)sender; using(Image i = Image.FromFile(doc.Tif)) { e.Graphics.DrawImageUnscaled(i,0,0); doc.PageNumber++; if (doc.PageNumber < doc.NumberOfPages) { // There is still at least one more page. // Signal this event to fire again. e.HasMorePages = true; } else { // Printing is complete. e.HasMorePages=false; } } } private void button1_Click(object sender, System.EventArgs e) { PrintDocument doc = new TiffDocument(@"C:\test.tif"); doc.PrintPage +=new PrintPageEventHandler(doc_PrintTiff); printDialog1.Document= doc; doc.Print(); }
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
The Documentation says it works with 1.1 but I'm not seeing the enum SpecialFolder.
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
I havn't had a lot of time to test anything so maybe the awnser is simple. How can i move a file to attach it to an ADS. I wan't to hide all the files in a directory behind a 0 text file. for ex. Move c:\myVidio\movie.avi to C:\myVidio\haha.txt:movie.avi Move c:\myVidio\movie2.avi to C:\myVidio\haha.txt:movie2.avi I'm looking to write a utility that can take directories and do this.
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
havn't tested but this could be it. still looking for ideas http://support.microsoft.com/kb/839272/en-us[^]
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Hi all, I have an obscure problem happening in my main data store folder. The folder contains 1136 subdirectories with a total of 2,397,000 or so files spread out over 121GB on a 1TB Raid 5 array. What’s happening appears to be a cache problem. The symptoms are as follows: A file (lets say ..Folder1\Inv1.tif , 65KB) is loaded then closed. The Directory containing the file then has its name changed, ..Folder2\Inv1.tif I can still access ..Folder1\Inv1.tif from any computer that has opened it from that path; however any new computer trying to open that path fails. The full path is a network share. The location of the accessing computer doesn’t seem to make a difference, Localhost, lan computer or workgroup computer all have the same behavior. I not sure if it is true for Mapped drives and local drives. My hunch is that the algorithm for sensing cache invalidations is having troubles iterating through such a large folder. I need some ideas on what the problem might be and a way to test it.
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Yes I am! Thank you!
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Thanks for the FileVersionInfo Tip. I think that will do the trick. It also returns the coments and other info I'm looking for. Right click on any file->proporties->summery and this class gives you access to all that. That was what i'm looking for. I woldn't have thought to look at FileVersionInfo FileInfo seemed like the right one Oh well Thanks again
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Well the stuff over in audio is specific to WMF so it's not much help. I’m looking for metadata from NTFS. I’ve googled ‘file properties dialog’ ‘ntfs metadata’ and many other combinations and synonyms of these phrases. All I want to do is programmatically right click on an exe and view its version info. Thanks though. I can't belive this is so hard. It was supose to be a QnD utility Ron
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
How to gain access to advanced file properties? For example, I want access to file version Other Version Information comments. Or file summary title and comments. I was hoping FileInfo would have that but from what I can see it doesn’t Thanks
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
I can make a DLL by using the create a class library project. And i can add a made dll as a reference into a new project but then i have to push the dll with the exe all the time. In C++ i can compile to a *.lib and tell the linker where the lib file is and it will compile the code from the lib into the exe and i don't need to push the lib all over the place. Is that possible in C#?
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
How do you compile to a library in C#. or how can i bring a DLL into the final exe so I don't have to install the dll. I have classes that i use often and don't like just copying the .cs into my project. I'd like a library to link from but don't know how to make it. Thanks
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Setteled on this foreach( string f in Directory.GetFiles(_ControleFileBucket)) { if( f.EndsWith("*." + CDoc.EmailCF) || f.EndsWith("*." + CDoc.FaxCF)||f.EndsWith("*." + CDoc.GMailCF)) { ...
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Hello, what i have is this foreach( FileInfo f in di.GetFiles("*.txt")) { //do something } foreach( FileInfo f in di.GetFiles("*.log")) { //do the same thing } what i wan't is this foreach( FileInfo f in di.GetFiles("*.txt, *.log")) { //do something } but di.GetFiles("*.txt, *.log") returns nothing. can i put in a RegEx or something?
Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Thanks for the link. I need all the help i can get with this two DBS thing. Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Too many sites to manage and a moving Db schema make them too hard to manage. Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Yeah that would work Great if I was always only going to use one where clause or if this was the only sql statement in the program. But tomorrow or a week from now, myself or some one else will have to edit the sql to return a smaller range and forget that its ordinal specific then spend 2h trying to figure out why its not working. Replace() is ordinal unspecific and works all the time. I envy all you programmers that get to use a static DB schema. Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net
Cool Thanks for the help. I Guess I'm going to just to Replace() on the input string then. The attraction of using parameters was that it allowed a bit of latitude in how the sql strings where made. Ronald Hahn, CNT - Computer Engineering Technologist New Technologies Analyst HahnTech Affiliated With Code Constructors Edmonton, Alberta, Canada Email: rhahn82@telus.net