|
thanks for reply
Actualy i modify the image with same name....
my code is bellow
If Not FileUpload1.HasFile = False Then
Dim filepath As String = FileUpload1.PostedFile.FileName
Dim pat As String = "\\(?:.+)\\(.+)\.(.+)"
Dim r As Regex = New Regex(pat)
Dim extention As String = GetExtension(filepath)
If (extention = "jpg" Or extention = "gif" Or extention = "jpeg" Or extention = "bmp" Or extention = "png") Then
Dim m As Match = r.Match(filepath)
Dim file_ext As String = extention
Dim filename As String = "" & Session("abc") & ""
Dim file As String = filename & ".jpeg"
'save the file to the server
FileUpload1.PostedFile.SaveAs(Server.MapPath(".\member_snap\") & file)
Image1.ImageUrl = "~/member_snap/" + Session("abc") + ".jpeg?timestringorGUID"
Label23.Text = "Upload Successfully"
Else
Label23.Text = "Upload jepg,gif,jpg,bmp,png file"
End If
End If
|
|
|
|
|
This line:
Image1.ImageUrl = "~/member_snap/" + Session("abc") + ".jpeg?timestringorGUID"
This is wrong, "timestringorGUID" i wrote to explain you where oyu ahve to write Time string or GUID string, not to write this leterally, lol.
Replace the above line with this one:
Image1.ImageUrl = "~/member_snap/" + Session("abc") + ".jpeg?" & Guid.NewGuid.ToString()
|
|
|
|
|
Did you wrote Image1.ImageUrl = "~/member_snap/abc.jpeg?timestringorGUID"? as i wrote to you or did you put it
Image1.ImageUrl = "~/member_snap/abc.jpeg?" & Guid.NewGuid().ToString
which is what i did think you will figure out what i try to tell you.
|
|
|
|
|
thanks for give me soliution..
my problem solved...
shall i hav your email id plz, for contact in future
|
|
|
|
|
Hi All ,
I have one problem in java script web site has 3 calender so when focus comes to any one of the text box then calender come so i can select date but if i press control should go the next control so is there any option so that i can find which text box has focus so that based on condition i can set focus to next statement.
Thanks ,
Amit
|
|
|
|
|
|
I think there is OnFocus and onBlur event for every html input control for doing this.
|
|
|
|
|
Hi,
I am trying to disable some items in listbox through javascipt in ASP.net
These items are disabling in IE8 but not disabling in IE6. How can I do it?
<br />
var lstRight = document.getElementById("lstSelection"); <br />
var fixedFieldIds = document.getElementById("hdnFixedFieldId"); <br />
var fieldIdArray = fixedFieldIds.value.split('^');<br />
<br />
if(fieldIdArray)<br />
{<br />
for(var i =0;i<fieldIdArray.length;i++)<br />
{<br />
for(var j=0; j<lstRight.options.length; j++)<br />
{<br />
if(lstRight.options[j].value == fieldIdArray[i])<br />
{<br />
lstRight.options[j].disabled = true;<br />
break;<br />
}<br />
} <br />
}<br />
} <br />
|
|
|
|
|
This is no ASP.Net question. There is a seperate Web Development [^]forum for these type of questions.
In between, IE8 and IE6 have different rendering engine. You can use IE Developer [^]toolbar to take a dig into it.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I got all available network printers but the problem is when I select Microsoft XPS Document Writer as my printer and give print Then there is an error
|
|
|
|
|
Why did you ask two similar questions ? What is the error ? It probably relates to permissions to write a file on the server.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
and Error is
himanshu
|
|
|
|
|
I want to get all network printers using ASP.NET &c# and want to avid the image printer like Microsoft Office Document Image Writer or Microsoft XPS Document Writer
|
|
|
|
|
You can't do that with ASP.NET. Not in any way. Unless your app runs over the same network, in which case, you can, assuming your client can see the same printers that your server can.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hello,
I am using VS 2005 and following is the code:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fp As StreamWriter
Dim line As String
Dim filename As String = System.Guid.NewGuid.ToString & ".Txt"
Try
fp = File.CreateText(Server.MapPath(filename))
line = "Normal Text" & Chr(27) & "E" & " Bold Text" & Chr(27) & "F"
fp.WriteLine(line)
line = "Normal " & Chr(27) & "S 0" & " It should be superscript" & Chr(27) & "T"
fp.WriteLine(line)
fp.WriteLine(Chr(27) & "4" & " Italic Mode" & Chr(27) & "5") ' Italic mode
fp.WriteLine(Chr(20) & " or it should be superscript " & Chr(20) & "Normal")
fp.WriteLine(Chr(15) & "Girish Kumar Sharma" & Chr(18)) ' condensed mode
'fp.WriteLine(Chr(12)) ' Page Eject
fp.Close()
Catch err As Exception
err.ToString()
Finally
End Try
Dim fpforbat As StreamWriter
Dim strFilePath As String = "c:\\temp\\" & System.Guid.NewGuid.ToString & ".Bat"
fpforbat = File.CreateText(strFilePath)
Dim x As String = "Type " & Chr(34) & Server.MapPath(filename) & Chr(34) & " > PRN"
fpforbat.WriteLine(x)
fpforbat.Close()
'Dim strFilePath As String = "c:\\temp\\test.bat"
Dim psi As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo("cmd.exe")
psi.UseShellExecute = False
psi.RedirectStandardOutput = True
psi.RedirectStandardInput = True
psi.RedirectStandardError = True
psi.WorkingDirectory = "c:\\temp\\"
Dim proc As System.Diagnostics.Process = System.Diagnostics.Process.Start(psi)
Dim strm As System.IO.StreamReader = System.IO.File.OpenText(strFilePath)
Dim sout As System.IO.StreamReader = proc.StandardOutput
Dim sin As System.IO.StreamWriter = proc.StandardInput
While strm.Peek() <> -1
sin.WriteLine(strm.ReadLine())
End While
strm.Close()
Dim stEchoFmt As String = "# {0} run successfully. Exiting"
sin.WriteLine(String.Format(stEchoFmt, strFilePath))
sin.WriteLine("EXIT")
proc.Close()
sin.Close()
sout.Close()
'File.Delete(Server.MapPath(".") & "\" & filename)
'File.Delete(strFilePath)
My Two questions:
1.How i will get super/sub script printing ?
2.If i remove the comment from any of last two line, code do'nt run.. no printing. Why ?
Please guide me how to resolve the issue(s).
Thanks & Regards
Girish Sharma
|
|
|
|
|
Wow - what a nightmare this is. What are you trying to do ? Does this cause things to print on the print ? Why do you want to write code that prints stuff on the server ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Sir,
Thanks for your reply. From the above code, i am creating a formated text file and one batch file which will be print the formated text file by using dos mode i.e. > PRN; but sir, problem is that if i wish to delete the formated and/or batch file, after run the code, i am not able to do so.
Regards
Girish Sharma
|
|
|
|
|
I repeat. Why do you want to emit a printout on the server ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I do'nt know, how to create the text file on client's machine; and what is another way to get the DOS mode (which runs faster) printing of a text file by asp.net, so please guide/help me in this regard.
Regards
Girish Sharma
|
|
|
|
|
The thing Christian wants to point out is that your application will use the printer installed on the server where you application is running. It means, every time the printout will be generated by the printer installed on the server, not on the machine from where you are accessing the web page.
|
|
|
|
|
At the first stage if it runs on server machine and printer; then my question will be how to access and client's printer to get printout. Actually, this is running fine on server printer but if i remove the comment from any of last two line i.e.
'File.Delete(Server.MapPath(".") & "\" & filename)
'File.Delete(strFilePath)
then no print out comes on the printer.
Please help me.
Regards
Girish Sharma
|
|
|
|
|
That may be because the print command hasn't finished when you delete the file but it isn't important if you want to print on the client machine anyway. Look into the javascript function window.print if you need to print client side.
|
|
|
|
|
None of this matters, you moron. You're printing on the server. Don't you read ? If you want to print on the client, none of the hideously ugly code you posted, will do that, nor is it possible to print in ASP.NET in any direct way through your code behind. Buy a basic ASP.NET book and read it, it's clear you have no idea what server side code is.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Sir,
I created the required formated text file with the help of above code. Now i wish to get print on Line Matrix Printer in DOS mode; so i read that it can be achieved by run a batch file. If it is not possible with the above code then; how do i print (DOS Mode) the generated text file at client machine on the click of a button in the web page, with the help of window.print and/or by any other mean please.
If you please provide me any link i shall be highly thankful to you.
Best Regards
Girish Sharma
|
|
|
|
|
Hi,
I have the requirement to encrypt my password with the PKCS #7 algorithm and store it to the sql server database. And to get the password also i need to decrypt with the same PKCS #7 algorithm. Is it possible with .Net code. Pls provide some help on how to do this encryption & decryption.
Tnx in advance
|
|
|
|