|
Ankit Rajpoot wrote: What I'm worried about is that the constant-value to file-attribute mapping is same on all Windows versions or not. For example, passing 15 returns the Artist's name from the file. Is it true for all Windows versions.
Yes, it is. If there are any changes, they are additions to the constant list. All previous constants will work the same way they did in previous versions of Win32.
|
|
|
|
|
Hi,
I have one problem and would like that when I click on the button is automatically saved me a report that the disk in pdf format. I can show it in pdf only does it can not be saved.
Anybody got any idea? I work in VS2003 asp.net (C #)
thanks
lp
private void Button1_Click(object sender, System.EventArgs e)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
SqlDataAdapter da = new SqlDataAdapter("select * from posta1" , sqlConnection1 );
da.Fill(dataSet11,"posta1");
myReport.Load(Server.MapPath(Request.ApplicationPath)+"\\CrystalReport1.rpt");
MemoryStream oStream; // using System.IO
myReport.SetDataSource(dataSet11);
oStream = (MemoryStream)
myReport.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat );
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}
modified on Monday, October 13, 2008 4:06 PM
|
|
|
|
|
Hello everyone,
Synopsis: I’m trying to recieve and process calls from clients via Remoting.
Architecture scenario 1
Server A (Console Application): receives and processes calls from clients via remoting ( TCP / Singlecall )
Architecture scenario 2
Server B (Windows Service): receives and processes calls from clients via remoting ( TCP / Singlecall )
Problem
Scenario 1 works; scenario 2 doesn’t work over the network with the same code. I receive a time-out after 40 seconds. Local it does work fine.
Servercode
TcpServerChannel channel = new TcpServerChannel(IdtProgrammaConfiguratie.Poort);
ChannelServices.RegisterChannel(channel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteClass), "RemoteClass", WellKnownObjectMode.SingleCall);
Clientcode
if (ChannelServices.RegisteredChannels.Length == 0)
ChannelServices.RegisterChannel(new TcpClientChannel(), false);
string server = servernaam + ":" + port.ToString();
RemoteClass serverRemotingObject = (RemoteClass)Activator.GetObject(typeof(RemoteClass), "tcp://"+server+"/RemoteClass");
test = serverRemotingObject.HandleRequest(query, databasenaam);
Errormessage:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.0.56:8989-
Server stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(EndPoint ipEndPoint)
at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at BCT_Group.RemotingConnector.HandleRequest(String Query, String Databasenaam)
at IDT_ComApi.ResponseXml.GetXmlResponse(String query, String host, Int32 port, String databasenaam) in C:\IDT_Com_Remote\IDT_ComApi\ResponseXML.cs:line 21
at IDT_ComObject_Remote.IDT_ComObject_Remote.Get_Response(String query, String host, Int32 port, String databasenaam) in C:\IDT_Com_Remote\IDT_ComObject_Remote\IDT_ComObject_Remote.cs:line 37
|
|
|
|
|
I had the same scenario and had problem with Windows Application and finally wrote that in Console and I'm working with it and have no problem, what about you? No problem? Fine... Well I had to go, bye
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hmmmm, I need to run a service; or is there a way to make the console application invisible to the user?
|
|
|
|
|
I don't know about a console app with no console - but you can do a WinForms app with no form very easily. Just remove the
Application.Run(new Form1());
line from the Program.cs file, then remove the not needed Form from the project.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
MegaBlasterX wrote: make the console application invisible to the user
What? A Console app have a Console which users can see. Wait a minute... We can pass Console inputs to a WinForm!
Application.Run(new Form1(Console.ReadLine()));
Yes, We can get the Server messages in Console and pas them throw our WinForm
While (true) { Human.isLearnable = true; }
|
|
|
|
|
hi guys
i am in need of an IRIS Recognition SDK, i downloaded Verieye it is good but the license has expired and it stopped working. any ideas please, its very important to me.
thank you everyone
|
|
|
|
|
If you're looking for a free one, I haven't been able to find one that does biometric ID. There are free libraries that can FIND an iris in an image, but that's about it.
|
|
|
|
|
Hi,
.net2 vs2005
Im creating a winform app that will display a list of images and some text under them. the images will be displayed horizontally across the screen and the user can scroll left or right using buttons.
I could display pictureboxes and text boxes across the screen but what I would like is something like a horizontally scrolling datagridview (where the rows are actually columns and the columns are rows) and i would use CellFormatting to display the images.
Is there a control that would enable me to do this or can someone point me in the right direction as to how to do this?
Many thanks.
Chas
|
|
|
|
|
Based on the description of what you've said, I wouldn't be relying on a datagrid or any other control in the ToolBox. I'd probably start by creating my own control to do this. I'd probably start with a scrollbar and a rendering system that only draws the thumbnails in the view.
|
|
|
|
|
Hi,
I managed to get it working using a datagridview - the issue was with having different datatypes in the same column...
Instead of binding to the datasource i looped through the datasource and and created and appended DataGridViewImageCell and DataGridViewTextBoxCell objects to DataGridViewRow objects.
Then adjusted some of the datagridview properties until it looked better...
Thanks,
Chas
|
|
|
|
|
Hey people I´m still having a little problem here!!! I´m trying to execute a program by double clicking on a file shown in List View... The methods to show fthe files and folder I did and it´s working well...
to execute a file I created a new mwthod executeFile
private void executeFile(TreeNode nodeCurrent)
{
Process.Start(getFullPath(nodeCurrent.FullPath));
Process.Start(String.Format("\"{0}\"", getFullPath(nodeCurrent.FullPath)));
}
as you can see getFullPath(nodeCurrent.FullPath) gets the path for the directory where the file is. I don´t know if I did right but do call the method I greated another by doubleclickin on th list view lvFiles_SelectedIndexChanged and called the method executeFile(nodeCurrent) but It doesn´t work... it says nodeCurrent doesn´t exists on the namespace...
I don´t know if I did executeFile right...
Could some good soul please help me????
Thanks!
|
|
|
|
|
Hi,
don't know if I understand everything. Does the compiler say "Namespace doesn't exists" or does this error occur during runtime?
Could you please post a bit more code, like the "lvFiles_SelectedIndexChanged" method?
Sebastian
|
|
|
|
|
Hi Sebastian!
The compiler says! Well the method just call execute file!!! Nothing more!
private void executeFile(TreeNode nodeCurrent)
{
Process.Start(getFullPath(nodeCurrent.FullPath));
Process.Start(String.Format("\"{0}\"", getFullPath(nodeCurrent.FullPath)));
}
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
executeFile(nodeCurrent);
}
I tried to use shell dll too! But a little bit lost with it....
I know that I maybe doing something wrong but... I´m more familiar with structured C.
|
|
|
|
|
Well,
where is nodeCurrent declared for lvFiles_SelectedIndexChanged? That's why the compiler says that there is no nodeCurrent...
You have to get it the current selected item from your listview. Something like:
lvFiles.SelectedItems[0]
By the way, are you using a TreeView or a ListView control?
Regards
Sebastian
|
|
|
|
|
It´s using both!!!! But treeView shows only folders ald list view only files!! I liked this way because it keeps wiewing more organized!
I tried another method BUT I´m also trying this
nodeCurrent is used to popuate lvFiles with files... it gets the current node and shows files. getFullPath gets the path from the root to the current node...
I tried shell too you might see it because it almost worked.. just for the detail that it opns the program but not the file (I know that I´m missing a line or some statement) I´m lost because it´s my first c# experience!!!!
|
|
|
|
|
First, it's not good practice to pass a TreeNode object to a method called "executeFile". It's kind of counter-intuitive. You should be passing in a string decribing the full path to a file. "executeFile" shouldn't need an entire TreeNode to do it's job.
Now, what does getFullPath return when you pass in a TreeNode??
|
|
|
|
|
Hello Dave!!!
getFullPath returns the path from the root to the current node!
Yeah it makes sense to me now!!! It´s totally silly to pass something that is pointing to a directory to execute a file.... It doesn´t needs to know WHERE THE FIE IS because it is already showing me the files!
I´m beginning to understand!
|
|
|
|
|
Hi Sebastian
I just tried another method that is ALMOST working!! Just a tiny detail that it open the program by doubleclicking the file BUT it doesn´t open the file itself!!!
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute();
shellExecute.Path = @"C:\Arquivos de programas\AutoCAD 2008\acad.exe";
shellExecute.Execute();
}
just a simple shell dll command!
Now I need to open the file itself!!! Any clue???
tnx!
|
|
|
|
|
Hello folks!
I´m almost reaching what I wanted to do! Now It does open the file... BUT JUST that file specified in the path on the code as you will see right down!
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute();
shellExecute.Verb = ShellLib.ShellExecute.OpenFile;
shellExecute.Path = @"F:\Painel de Controle ETECH\Projetos ETECH\Acessórios\80010005.dwg";
shellExecute.Execute();
}
It will open ONLY 80010005.dwg
"Projetos ETECH" is the root node (folder) and contains a lot of childs (subfolders of especific projects) wich contains CAD drawings (thousands millions of DWGs). I need a way to get the path of any selected file. What I thought was to create a method that gets the path where you are and the name of the file you selected (string) and put them together to for the path to te file to be executed...
Am I in the right way or there is something easier????
Best Regards for all you!!!!
|
|
|
|
|
Hi,
it's me again. Sry, for didn't answering yesterday, was on my way home.
Okay, so opening the file is not the problem. The problem is to get the path and name of the file to open. So let me guess that you doing something like this.
public string getFullPath(string sPath) {
string sFileName = lvFiles.SelectedItem[0].Text;
return System.IO.Path.Combine(sPath, sFileName);
}
private void executeFile(TreeNode nodeCurrent)
{
Process.Start(getFullPath(nodeCurrent.FullPath));
Process.Start(String.Format("\"{0}\"", getFullPath(nodeCurrent.FullPath)));
}
If you are doing this, you get an error from the compiler? Did you include the Namespace (using System.Windows.Forms)? Or rewrite it to
private void executeFile(System.Windows.Forms.TreeNode nodeCurrent) {
...
}
Does this solve your problem?
Regards
Sebastian
|
|
|
|
|
I've received a DLL written in VB.NET to use in my C# application.
I can add a reference to the DLL in my C# app; and can also initiate an object of a class.
Now is the problem that i can't see the properties of this class in C#; while i can see them in VB.NET ( their all public).
Anyone any suggestions how to solve this?
Thanks in advance
|
|
|
|
|
What I have Done :
1: Create A Solution and Create a Windows Application in C#.
2. Right Click On Soluntaion -> Add New - > Class Library ( Choose Langauge as VB.NET )
3: Create a Class Library (MyLibrary) in VB.NET
4. Create Class as Class1 and Two Function A1() and A2() as Public.
5. Build The Class Library.
6.Back To My C# Application, Right Click on Reference -> Add -> Projects
Add MyLibrary.Dll
7. in C# code
using MyLibrary;
Now you can Able to Create Object of Class1
Class1 C1=new Class1();<br />
C1.A1()
C1.A2()
Now Try To Following Steps, Hope you will do it. that I have just done it.
cheers,
Abhijit
|
|
|
|
|
Thank you; I've made a conversion class in a VB.NET ClassLibrary1 and i can use the DLL now.
|
|
|
|