|
This is really an ASP question, but since I'm using C#, I'll post it here. I'm having trouble accessing remote files (or directories) out of my application. I simply want to check if a file exists on the other machine, which is shared on the same network. No dice, always comes up false. I have set up the IUSR_ComputerName and IWAM_ComputerName accounts on the remote computer to match my IIS account. Still returns only false. I've mapped a drive to the network location, and then put that mapped drive into a virtual directory. In the IIS Administrator I can see the files I'm trying to reach through this virtual directory...but the application only returns false.
Here's the code from my application:
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
if (System.IO.Directory.Exists("Drive"))<br />
Response.Write(Server.MapPath("Drive") + " Exists<br>");<br />
else<br />
Response.Write(Server.MapPath("Drive") + " does not exist<br>");<br />
}
Thanks for the help on this. If anybody knows another method of accomplishing this same task, I'm all ears. All I can report is that we don't want to run IIS on the remote machine, and we don't particularly want to spawn an application to take care of the file maintenance...we'd like for the code to handle it.
|
|
|
|
|
What is Drive ? in if (System.IO.Directory.Exists("Drive"))
Please substitute "Drive" as "x:\\" should work..( where x is mapdrive letter)
or
if (System.IO.Directory.Exists("\\\\MachineName\\ShareName\\FolderName")) should do
Sandeep Naik
|
|
|
|
|
Drive is the name of my virtual directory, which maps to what you call x:
|
|
|
|
|
As Sandeep correctly mentioned, you're looking for the wrong directory.
You need to wrap "Drive" in a call to Server.MapPath() as well when calling System.IO.Directory.Exists(), otherwise you're actually searching for a Direcory named "Drive" instead of the mapped one.
Regards,
mav
|
|
|
|
|
Hi,
I am a writing a program in which a user can open a file in some application by creating a new instance of that application. But what I want to do is see if that application is already open (the user opened it not through my program, but by double clicking the application icon) in which case use the already open application to display the file instead of creating a new instance.
How can I do it.
Thanks
|
|
|
|
|
One way to do this
if ( System.Diagnostics.Process.GetProcessesByName("processname").Length == 0 )
MessageBox.Show("Process not running");
else
MessageBox.Show("Process is running");
Sandeep Naik
|
|
|
|
|
Mr. Sandeep,
I guess you got the question wrong. Once I find that a application is already open, Is there a way that i can open a file in that, instead of creating a new instance of the application and then opening a file.
Thanks
|
|
|
|
|
There is, and a simple search for single instance application[^] would return several results, including Single Instance Application in VB.NET[^], which should be easy enough to translate (it's mostly calls to the BCL).
You can also communicate with the first instance through .NET Remoting - the preferred method - or native RPC, named pipes, DDE, or many other ways (but those are all native, which requires extra code in order to call necessary APIs).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
I'm assuming it's the .NET Framework V2.0 beta - am I right?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
|
Hello All
My question is this that how to embed a flash movies on a form? I'm using Macromedia Flash Obejet (A COM(+) control. I 'm the path of Movie in Movie property but it's not showing can any body helo me what to doo how to set properties plzzzzz. I'll be very thankful.
Cheers Bye
Rizwan Ahmed
|
|
|
|
|
Have you tried using acimp utility in the frameworks BIN folder on the activeX component, it should produce .net assemblies for you to use with your app.
|
|
|
|
|
There's samples on this website. I'm pretty sure. Do a search.
/\ |_ E X E GG
|
|
|
|
|
If you've dragged the control from your toolbox (after customizing and adding it to your toolbox) to the form, or if you've used aximp.exe (not acimp.exe like the other poster said), then you reference both the AxInterop.*.dll and Interop.*.dll (or whatever you called them if you used aximp.exe and specified the /out switch). These are the ActiveX control (derived from System.Windows.Forms.AxHost ) and the RCW (Runtime Callable Wrapper, a wrapper around the COM server generated from the typelib) respectively.
After you've done that, read the documentation for the ActiveX control on Macromedia's web site (or just take a stab and guess). The classes, interfaces, enumerations, methods, properties, etc. are all the same as they would be from a COM client like Visual Basic or some scripting language, because the RCW is marshaling calls to the COM (automation) objects themselves that scripting clients use.
There have also been articles on this site written about similar topics (perhaps even embeddeding the Flash player). I suggest using the search bar underneath the CodeProject logo at the top of the page to search for existing articles.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hi All,
I need help. I want to extract the ISO file to the local harddrive. Is there an sample code or some sample written in VC++ 6.0 or C#, which I can take a look. Please help.
Thank You
Regards,
ntuyen01
|
|
|
|
|
Get IsoBuster: www.isobuster.com[^] (go to site and click on download on left.) The free (non-Pro) version does everything I've needed.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
can anyone give me instructions to build a basic web broser,what's necessery and needed to archive this?
...NLD...
|
|
|
|
|
|
Dear CPians,
I am trying to convert a Bitmap object to a byte array so I can save it into an Image fiels in SQL Server 2000.
Any examples?
Thank you!
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
private byte[] BmpToBytes(Bitmap bmp)
{
using(MemoryStream ms = new MemoryStream())
{
bmp.Save(ms, ImageFormat.Bmp);
return ms.ToArray();
}
}
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
Thank you for your reply!
This seems to be axactly what I need!;P;P
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
I need your help on following code segment.
DataSet ds=new DataSet();
da.Fill (ds, "Price");
DataTable newdt=new DataTable();
for (int i= 0; i<=ds.Tables["Price"].Rows.Count-1; i++)
newdt.Columns.Add(i.ToString());
for (int i=0; i<=ds.Tables["Price"].Columns.Count-1; i++)
for (int y = 0; y<=ds.Tables["Price"].Rows.Count-1; y++)
dr[i]=ds.Tables["Price"].Rows[y].ItemArray[i].ToString();
newdt.Rows.Add(dr[i]);
What I am trying to accomplish is to loop through one data set and do a flip-flop of data on the fly, ie. rows on the first dataset table become columns of the finished one's. Then bind the result to UI control.
The data in the table looks like this:
DisctType/QtyBreak/UnitPrice
A........./0 to 100/$10.00
A........./101 to 300/$9.00
B........./5000 & up/$2.25
The UI has to make data look as follow:
DisctType/A........./A.........../B
QtyBreak/0 to 100/101 to 300/5000 & up
UnitPrice/$10.00../$9.00....../$2.25
I think I am down to last two lines but just could not pull it off.
|
|
|
|
|
I created a windows service in c# and then installed it using both the InstallUtil and Setup project options in VS.NET but the service is NOT available from the Services Management Console.
I even went ahead and created a bare-bones windows service, installers included, compiled it and installed it but it is a NO SHOW as well.
I am in the administrators group of the machine I am using to develop.
Does anybody has an idea what else do I have to do to get to the Services Console?
>
Guillermo Jimenez
|
|
|
|
|
What Installer classes are you using, specifically? You must use both ServiceInstaller and ServiceProcessInstaller , and both instances must be added to your Installer derivative's Installers collection property. Additionally, your Installer derivative must be attributed with the RunInstallerAttribute .
When running InstallUtil.exe, display verbose output with the /v command-line switch and make sure your type (your Installer derivative class) is found.
If you right-click in the Windows Service designer, you can click "Add Installer" or something like that. Examine the code there to make sure you're coding your installer correctly.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
All that is in place.
The /v option doesn't give me any hint of error anywhere, everything is found, compiled and committed.
By the way this is a Windows 2000 (v5.) machine.
|
|
|
|