|
Here is the best link i have seen so far but i want to know if there exist a control for that.
http://www.codeproject.com/Messages/2663987/Re-panels.aspx[^]Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
When someone responds to your question, if you use the "Reply" on the message they post, then your message is added to theirs, and they get an email to say you have more information / further questions for them. Otherwise, you just have to wait and hope they see your new input - not guaranteed. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:08am.
|
|
|
|
|
Thank you a million fold. You are super cool Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
hi
i was filling checkedListBox like this:
SQL = "select distinct TrapName,substr(TrapNum,1,4) from TrapTbl order by substr(TrapNum,1,4) ";
adp = new OracleDataAdapter(SQL, Conn);
dsView = new DataSet();
adp.Fill(dsView, "TrapTbl");
adp.Dispose();
this.ListAtar.DataSource = dsView.Tables[0];
this.ListAtar.DisplayMember = dsView.Tables[0].Columns[0].ColumnName;
this.ListAtar.ValueMember = dsView.Tables[0].Columns[1].ColumnName;
my question is, when i pick some items from the checkedListBox
and i press a button - how to get a list of the ID - the ValueMember ??
thank's in advance
|
|
|
|
|
you need to use ItemCheck event like this
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
Console.WriteLine(checkedListBox1.SelectedValue.ToString());
}
} Life's Like a mirror. Smile at it & it smiles back at you.- P Pligrim
|
|
|
|
|
Make sure that your check box property that is autopostback is true.
|
|
|
|
|
I have made an app that has a webBrowser and uploads via ftp. When testing in the Visual C# IDE, all is well - the browser loads fine and ftp connections are established, allowing files to be uploaded successfully.
However, upon running the exe from my xp desktop, the browser control fails to load, and ftp does not connect After scouring the internet for related posts and demos I'm still not sure why this could be. Incidentally, the other browser demos do not load either, so I'm inclined to think that it must be my firewall, port, other xp settings.
In a quick check in dos, port 21 (which is required apparently for ftp) is *not* open. Nor is port 80.. Should I need to speak to my isp about this? Why can I run the program ok in the ide? Is the compile failing to package any required connectivity associated files?
I very much hope that someone can help modified on Saturday, February 27, 2010 7:47 PM
|
|
|
|
|
Hi,
I don't know what is causing this; I think I do know how to find out: make sure your code reports all possible problems, i.e. when a try-catch block is present, make sure the catch block reports the entire exception using Exception.ToString() either to a MessageBox, a log file, or anything else that is accessible to the user. Also when methods return a status value, make sure to test it and log all anomalies. That way, the program itself should find out and tell you what exactly is failing, thus providing a clue as to how to fix it.
Also make sure all exceptions will be caught:
- put a big try-catch around the top-level method executed by each thread or background worker;
- put a big try-catch block around the content of your static Main() method;
- add an Application.ThreadException handler that logs the exception.
Good luck.Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for your concern and the good advice. I will try that although there isnt a whole lot to catch in my entire code, especially the webBrowser (I've stripped it down to it's bare basic, even less code than its origin, from the standard C# Studio 2008 tutorial):
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
Outside of the IDE, the browser doesn't load ('navigation has been canceled') and the ftp doesn't connect (I'm already catching it on initial WebRequest requestcreate = WebRequest.Create("ftp://..."), so it's easy to spot what is breaking. I've been considering adapting some code I found for firewall exceptions - should this really be necessary for the default web browser control?
I *do* very much hope that someone can recommend another way of testing my port and firewall settings with regards to this issue. I am certain that it can be resolved in windows rather than debugging my code, so if anyone knows of any good network diagnostic software or dos network/socket/port commands that may help, please do tell me!
By the way when I right click and choose properties on the page I get hef="res://ieframe.dll/ErrorPageTemplate.css..."
I have searched about res://ieframe.dll/ to no avail as of yet.modified on Saturday, February 27, 2010 8:35 PM
|
|
|
|
|
It was Comodo anti-virus! lol 
|
|
|
|
|
I have a web-browser control and a HTML tag inside which im not familiar with.
Anyway ive filled in the form with the set attribute method and invoked its submit button with this delay directly underneath
while (LoginBrowser.IsBusy == true)
{
Application.DoEvents();
}
This works when the credentials are correct but im trying to detect when invalid credentials are entered in which case a massage is somehow injected into the HTML even when javascript is disabled in the browser.
TextWriter tw = new StreamWriter("output.htm");
tw.WriteLine(LoginBrowser.DocumentText);
tw.Close();
System.Diagnostics.Process.Start("output.htm");
The above is spitting out the original html form without the error message so my problem is finding a way to reliably detect when the code has been injected .
Ive tried using the Document completed event but the browser isnt navigating anywhere.modified on Saturday, February 27, 2010 4:23 PM
|
|
|
|
|
Hello,
i am using VS2008 and SQLServer 2005.
my user should be able to store files/pictures in my app.
what is the best way to save files like pictures at runtime ?
where should i store them ?
thanks
bye jo
|
|
|
|
|
You could create a folder and toss the files in there. Or you could store them in a SQL Server 2005 database. If you are storing the data on the user's computer, you should probably use a folder, as getting a full running instance of SQL Sever 2005 on a user's computer is a pain. If you are storing the data on a central server, I'd go with storing it in your database (that way, all your data is stored in one place). That way, when you want to do a backup, all your data is in one place, so you only need to backup the database and you are done. In SQL Server 2005, you can use a varbinary(max) column to store file data.
|
|
|
|
|
If using local file storage, I normally use the system defined folders as there shouldn't be any permission problems reading/writing from/to these.
string userPath =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string allUsersPath =
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
[Edit] There are some problems if a different user needs to overwrite an existing file in CommonApplicationData. See solution here[^]. [/Edit]
|
|
|
|
|
Hi Dave,
FYI: I haven't used Win7 myself yet, however Christian[^] reported some problems with appdata.
Any comment on the matter?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Not tried it under Weven, but my test dev machine with weven is fired up so will test it now
|
|
|
|
|
 This works for me...
Test Code:
using System;
using System.IO;
namespace ConsoleApplication
{
class Program
{
public static readonly string UserPath =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
public static readonly string AllUsersPath =
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
static void Main(string[] args)
{
try
{
string fileName = "Test.txt";
string textToSave = "AbcDefGhi";
string userFilePath = Path.Combine(UserPath, fileName);
string allUsersFilePath = Path.Combine(AllUsersPath, fileName);
using (TextWriter userTextWriter = new StreamWriter(userFilePath),
allUsersTextWriter = new StreamWriter(allUsersFilePath))
{
Console.WriteLine("Writing {0} to {1}", textToSave, userFilePath);
userTextWriter.WriteLine(textToSave);
Console.WriteLine("Writing {0} to {1}", textToSave, allUsersFilePath);
allUsersTextWriter.WriteLine(textToSave);
}
using (TextReader userTextReader = new StreamReader(userFilePath),
allUsersTextReader = new StreamReader(allUsersFilePath))
{
Console.WriteLine("Reading from {0}", userFilePath);
Console.WriteLine(userTextReader.ReadLine());
Console.WriteLine("Reading from {0}", allUsersFilePath);
Console.WriteLine(allUsersTextReader.ReadLine());
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
Console.ReadKey();
}
}
}
[Edit] Added exception checking [/Edit]
[Edit2] Removed inner exception log as per Luc's post below [/Edit2]
|
|
|
|
|
Thanks.
assuming you are logged in as a regular user, not a sysadmin, and UAC is enabled and working normally, that means Win7 behaves like Vista in this, and CG somehow ran out of luck again!?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Yeah, just a regular default Win7 install with no tweaking. The account is under the 'Administrators' group as is the default for the first installed user rather than a limited account, but scratching a [insert body part here] still requires UAC elevation so no special permissions have been requested or granted to the account.
I think CG has just been 'Graused' again.
|
|
|
|
|
Interesting...
I just created a 'Standard User' account and tested the test code .exe under that account and it failed!
Even the exception wasn't caught! Just a Win7 dialog, un-collapsing the details panel shows
Problem Event Name: CLR20r3
Problem Signature 01: consoleapplication.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4b89d18d
Problem Signature 04: mscorlib
Problem Signature 05: 2.0.0.0
Problem Signature 06: 4a275af7
Problem Signature 07: 344b
Problem Signature 08: 15a
Problem Signature 09: System.UnauthorizedAccess
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 2057
I'll invesigate this more tomorrow
|
|
|
|
|
thanks again. And a nice cliff hanger. Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Couldn't go to bed with that on my mind!
The problem is I left the file in the 'CommonApplicationData' folder (X:\ProgramData\Test.txt) from when I ran under the admin account. The Standard User account could not overwrite it as it was created by a user from the Administrators group.
I deleted it using the admin account, switched to the Standard User, it ran perfectly and could overwrite the file it created itself with no issues on multiple runs.
|
|
|
|
|
More curious...
The file created by the Standard User can't be overwritten by the user from the 'Administrators' group either.
System.UnauthorizedAccessException:
Access to the path 'X:\ProgramData\Test.txt' is denied.
|
|
|
|
|
yeah, I would expect:
1. AppData to be individual and hence writable and readable for the user account;
2. CommonAppData to be common to everyone, hence readable by everyone, but writable only by someone who can install the app.
Haven't seen it documented in any detail however.
BTW: if number 2 is what MS intended, CommonAppData does not make much sense, the folder holding the EXE would offer the same characteristics.
[EDIT] Well, it does keep settings apart from distributed code, so app settings would have a better chance of surviving an app upgrade[/EDIT]
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|