|
Can you show us your code?
|
|
|
|
|
Logging in is not enough to be an administrator. You should run your program as administrator. Also if your program does not give your an error message, it's probably because you aren't checking for any errors. (boo! boo!).
If it fails to create a directory, you should not be creating your directory there in the first place (Places like the root of c:, program files, windows, etc... are taboo.
|
|
|
|
|
AFAIK the situation is the same on Vista and Windows 7, and will continue to be so on newer versions of Windows:
- a lot of directories cannot be modified by a regular user; those include the top-level directory of your system partition (usually C: ) and all important directories such as /Windows, /Windows/system32, and /Program Files.
- as Michel said, you need an administrator account AND an app "running as administrator" so get over those restrictions.
What should work though is access to a number of special folders intended to hold your app's settings and local data, and other things like that. Have a look at Environment.GetFolderPath() and Environment.SpecialFolder
Within such directories, one usually creates a hierarchy of folders, so a typical sequence would be:
string fileSpec=Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)+
@"\companyName\appName\logfile.txt";
string folder=Path.GetDirectoryName(fileSpec);
Directory.CreateDirectory(folder);
StreamWriter writer=File.CreateText(fileSpec);
...
|
|
|
|
|
|
Parallel.For is part of .NET 4.0, that uses a CLR version different from .NET 3.5.
So you can't use Parallel.For or any 4.0 new feature in a 3.5 or older project.
EDIT: Please, do not delete your message after someone answered you.
|
|
|
|
|
Hi,
I need a way to check which URL's are available on a specific name server, so which urls are registered there. How can I do this?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
name servers don't contain urls they contain names which can be expanded to fqdn's. You access these names through your favorite dns client (nslookup) for instance, and issue a list command. The administrator of the dns server will probably have disallowed this, because it's a cheap trick used by amateur hackers to discover addresses on networks. If you explain to us what your final purpose is, and persuade us that your intentions are legal, we MIGHT explain some more.
|
|
|
|
|
Matter has been dealt with privately. Please ignore the question.
|
|
|
|
|
Hi
Im having a problem making the background of a label transparent. I have a label on top of a picturebox and I make the labels parent the picturebox. I also set the labels backcolor to transparent. For some reason the label just disapears when I do this. Does anyone have any ideas?
Thanx
|
|
|
|
|
Try by setting the textbox's parent to the picture box and also by bringing the label to the front.
Something like
Label1.Parent = PictureBox1;
Label1.BringToFront(); .
|
|
|
|
|
Setting the background to Color.Transparent tells the label control to inherit the background properties of it's parent container. It does NOT make the background transparent.
In order to do what you want, you'd have to create your own label control and render it yourself. Your not the first person to want to do this. There are a ton of examples of doing a true TransparentLabel ono the web. All it takes is a little Google to find them. ".net transparent label[^]"
|
|
|
|
|
|
Hi Programmers,
I am rewriting some of my COM Server (Out proc) executable to .Net enviornment.
I havn't found any clue for same, I have googled for same, but everytime I encountered IN_PROC DLL only. might i am searching from wrong keyword.
Actually I needed executable, who expose it's class or interface to dot net application and work accordingly. I have found workaround using IPC DotNet Remoting. i.e. creating class library as proxy and subscribing event in both Client and outproc exe, but it is not full proof.
So please help me if you know something in this reqards
Thanks
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
Can please anyone tell me that How to get the IP Address of the network printer through the codeing in .NET using C#.
Thanks
|
|
|
|
|
Use WMI to read all your printer properties. For a sample, see here,
|
|
|
|
|
Hello my friends. I am going to do a senior project and we found that Mobile banking is going to be a good project. Is it possible to do it in C# with less than 4 months? Or if you have any idea about this or if you worked on it, please help me out. Thank you
|
|
|
|
|
|
Hi all,
is there any way that we can bind Textboxes to a member varaible data for display , like we do in MFC ?
if so pls advice.
|
|
|
|
|
Public form properties and DataBindings ...
public partial class Form1 : Form {
public string TheMember { get; set; }
private TextBox _textBox;
public Form1() {
InitializeComponent();
TheMember = "Hello";
_textBox = new TextBox();
_textBox.DataBindings.Add( "Text", this, "TheMember" );
this.Controls.Add( _textBox );
}
}
|
|
|
|
|
Thanks Gerry Schmitz for your time.
|
|
|
|
|
There is an image capturing device which outputs images in wmf. This image is directly stored in the db. These images are supposed to appear on web page (in IE). Only some of the images appear; others don't. When we investigated the problem we observed various things:
a) Those problematic images don't appear visible on the web page, but they are still there! If you right click the image and try to save it on your hard disk from IE browser, you get a file.
b) This file is viewable via desktop image viewers like Microsoft Picture Viewer.
c) We can view this image if we convert the file into jpeg.
The jpeg alternative seem viable, but its simply too much processing on the web server if we adpoted that approach. Its only that some of these images have this problem. We have millions of records of data with images. We figure only 10 % of images do have the issue.
Is there a way to detect such problematic wmf files?
|
|
|
|
|
When i wanna to see the "Datatable visualizer" I get Error of :
unable to cast object of type 'Custom Exception DataHolder' ...
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'CustomExceptionDataHolder' to type 'CustomExceptionDataHolder'.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.ManagedShim.DelegatedHost.CreateViewer(IntPtr hwnd, HostServicesHelper hsh, SafeProxyWrapper proxy)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
Microsoft.VisualStudio.CommonIDE
Assembly Version: 9.0.0.0
Win32 Version: 9.0.30729.1
CodeBase: file:----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:----------------------------------------
Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 9.0.0.0
Win32 Version: 9.0.30729.1
CodeBase: file:----------------------------------------
Microsoft.VisualStudio.DebuggerVisualizers
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42
CodeBase: file:----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
I searched a lot in google but not get the ans!
So please Help!
|
|
|
|
|
In your project go to "References" and delete any reference which have any concerns with "Visualizers".
It will work, because updates have been done on your system with visualizers components, like microsoft updates, so deleting this reference which references to new type of datatables and datasets <Template> should do the job.
Let me know if i can help in any other way.
Hope it helps.
|
|
|
|
|
I am building a project. It will have a main menu/GUI from which many application/options will be "spawned."
What is a good way to build the main menu so as to allow someone to add an app without having to recompile the main menu?
Gene
==============================================
100 years from now, what do you want people to read on your tombstone?
I want them to read:
"Here lies a man of integrity whose reach always exceeded his grasp and who knew the difference between honor and duty.”
==============================================
|
|
|
|
|